Skip to content

Commit f614d64

Browse files
author
The Android Open Source Project
committed
auto import from //branches/cupcake_rel/...@140373
1 parent e037fd7 commit f614d64

File tree

10 files changed

+24
-21
lines changed

10 files changed

+24
-21
lines changed

fastboot/fastboot.c

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ int match_fastboot(usb_ifc_info *info)
138138
{
139139
if(!(vendor_id && (info->dev_vendor == vendor_id)) &&
140140
(info->dev_vendor != 0x18d1) &&
141+
(info->dev_vendor != 0x0451) &&
141142
(info->dev_vendor != 0x0bb4)) return -1;
142143
if(info->ifc_class != 0xff) return -1;
143144
if(info->ifc_subclass != 0x42) return -1;

rootdir/etc/init.goldfish.rc

+1-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ service goldfish-setup /system/etc/init.goldfish.sh
3939
oneshot
4040

4141
service qemud /system/bin/qemud
42-
socket qemud_gsm stream 666
43-
socket qemud_gps stream 666
44-
socket qemud_control stream 666
42+
socket qemud stream 666
4543
oneshot
4644

4745
# -Q is a special logcat option that forces the

rootdir/init.rc

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ on boot
138138
chown system system /sys/class/leds/keyboard-backlight/brightness
139139
chown system system /sys/class/leds/lcd-backlight/brightness
140140
chown system system /sys/class/leds/button-backlight/brightness
141+
chown system system /sys/class/leds/jogball-backlight/brightness
141142
chown system system /sys/class/leds/red/brightness
142143
chown system system /sys/class/leds/green/brightness
143144
chown system system /sys/class/leds/blue/brightness

vold/blkdev.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@ int blkdev_refresh(blkdev_t *blk)
134134
struct dos_partition part;
135135
int part_no = blk->minor -1;
136136

137-
dos_partition_dec(block + DOSPARTOFF + part_no * sizeof(struct dos_partition), &part);
138-
blk->part_type = part.dp_typ;
137+
if (part_no < 4) {
138+
dos_partition_dec(block + DOSPARTOFF + part_no * sizeof(struct dos_partition), &part);
139+
blk->part_type = part.dp_typ;
140+
} else {
141+
LOGW("Skipping partition %d", part_no);
142+
}
139143
}
140144

141145
out:

vold/format.c

+7-8
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,14 @@ int format_partition(blkdev_t *part, char *type)
3737
devpath = blkdev_get_devpath(part);
3838

3939
if (!strcmp(type, FORMAT_TYPE_FAT32)) {
40-
char *args[7];
40+
char *args[6];
4141
args[0] = MKDOSFS_PATH;
42-
args[1] = "-F 32";
43-
args[2] = "-c 32";
44-
args[3] = "-n 2";
45-
args[4] = "-O android";
46-
args[5] = devpath;
47-
args[6] = NULL;
48-
rc = logwrap(6, args);
42+
args[1] = "-c 32";
43+
args[2] = "-n 2";
44+
args[3] = "-O android";
45+
args[4] = devpath;
46+
args[5] = NULL;
47+
rc = logwrap(5, args);
4948
} else {
5049
char *args[7];
5150
args[0] = MKE2FS_PATH;

vold/logwrapper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void child(int argc, char* argv[]) {
9393
argv_child[argc] = NULL;
9494

9595
// XXX: PROTECT FROM VIKING KILLER
96-
if (execvp(argv_child[0], argv_child)) {
96+
if (execv(argv_child[0], argv_child)) {
9797
LOG(LOG_ERROR, "logwrapper",
9898
"executing %s failed: %s", argv_child[0], strerror(errno));
9999
exit(-1);

vold/misc.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ void *read_file(char *filename, ssize_t *_size)
5959
close(fd);
6060
return buffer;
6161
}
62-
char *truncate_sysfs_path(char *path, int num_elements_to_remove, char *buffer)
62+
char *truncate_sysfs_path(char *path, int num_elements_to_remove, char *buffer, int buffer_size)
6363
{
6464
int i;
6565

66-
strcpy(buffer, path);
66+
strncpy(buffer, path, buffer_size);
6767

6868
for (i = 0; i < num_elements_to_remove; i++) {
6969
char *p = &buffer[strlen(buffer)-1];
@@ -81,7 +81,7 @@ char *read_sysfs_var(char *buffer, size_t maxlen, char *devpath, char *var)
8181
char *p;
8282
ssize_t sz;
8383

84-
sprintf(filename, "/sys%s/%s", devpath, var);
84+
snprintf(filename, sizeof(filename), "/sys%s/%s", devpath, var);
8585
p = read_file(filename, &sz);
8686
p[(strlen(p) - 1)] = '\0';
8787
strncpy(buffer, p, maxlen);

vold/uevent.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ static char *get_uevent_param(struct uevent *event, char *param_name)
239239
static int handle_powersupply_event(struct uevent *event)
240240
{
241241
char *ps_type = get_uevent_param(event, "POWER_SUPPLY_TYPE");
242-
char *ps_cap = get_uevent_param(event, "POWER_SUPPLY_CAPACITY");
243242

244243
if (!strcasecmp(ps_type, "battery")) {
244+
char *ps_cap = get_uevent_param(event, "POWER_SUPPLY_CAPACITY");
245245
int capacity = atoi(ps_cap);
246246

247247
if (capacity < 5)
@@ -307,7 +307,7 @@ static int handle_block_event(struct uevent *event)
307307
return -EINVAL;
308308
}
309309

310-
truncate_sysfs_path(event->path, n, mediapath);
310+
truncate_sysfs_path(event->path, n, mediapath, sizeof(mediapath));
311311

312312
if (!(media = media_lookup_by_path(mediapath, false))) {
313313
#if DEBUG_UEVENT

vold/vold.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int volmgr_bootstrap(void);
8989
int switch_bootstrap(void);
9090

9191
void *read_file(char *filename, ssize_t *_size);
92-
char *truncate_sysfs_path(char *path, int num_elements_to_remove, char *buffer);
92+
char *truncate_sysfs_path(char *path, int num_elements_to_remove, char *buffer, int buffer_size);
9393
char *read_sysfs_var(char *buffer, size_t maxlen, char *devpath, char *var);
9494

9595
void ums_hostconnected_set(boolean connected);

vold/volmgr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static volume_t *vol_root = NULL;
4343
static boolean safe_mode = true;
4444

4545
static struct volmgr_fstable_entry fs_table[] = {
46-
{ "ext3", ext_identify, ext_check, ext_mount , true },
46+
// { "ext3", ext_identify, ext_check, ext_mount , true },
4747
{ "vfat", vfat_identify, vfat_check, vfat_mount , false },
4848
{ NULL, NULL, NULL, NULL , false}
4949
};

0 commit comments

Comments
 (0)