aboutsummaryrefslogtreecommitdiffstats
path: root/roots.c
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2011-02-09 16:32:42 -0800
committerKoushik Dutta <koushd@gmail.com>2011-02-09 16:32:42 -0800
commitc7ef9af5d79e468c1a71507f5208f8d85b6b597a (patch)
tree31127a0745eed53da82e7af94f0bd0b3a8ae1cf4 /roots.c
parent49ee9a8b093b5acf4c80fca26612070cac20beac (diff)
downloadbootable_recovery-c7ef9af5d79e468c1a71507f5208f8d85b6b597a.zip
bootable_recovery-c7ef9af5d79e468c1a71507f5208f8d85b6b597a.tar.gz
bootable_recovery-c7ef9af5d79e468c1a71507f5208f8d85b6b597a.tar.bz2
Change-Id: Id6ee1fed1eebbaa6d3a9e6117910f00a56378da4
Diffstat (limited to 'roots.c')
-rw-r--r--roots.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/roots.c b/roots.c
index 7c4e241..4ef5c37 100644
--- a/roots.c
+++ b/roots.c
@@ -70,11 +70,11 @@ void load_volume_table() {
device_volumes = realloc(device_volumes, alloc*sizeof(Volume));
}
device_volumes[num_volumes].mount_point = strdup(mount_point);
- device_volumes[num_volumes].fs_type = strdup(fs_type);
+ device_volumes[num_volumes].fs_type = fs_type2 != NULL ? strdup(fs_type2) : strdup(fs_type);
device_volumes[num_volumes].device = strdup(device);
device_volumes[num_volumes].device2 =
(device2 != NULL && strcmp(device2, "NULL") != 0) ? strdup(device2) : NULL;
- device_volumes[num_volumes].fs_type2 = (fs_type2 != NULL && strcmp(fs_type2, "NULL") != 0) ? strdup(fs_type2) : NULL;
+ device_volumes[num_volumes].fs_type2 = fs_type2 != NULL ? strdup(fs_type) : NULL;
++num_volumes;
} else {
LOGE("skipping malformed recovery.fstab line: %s\n", original);
@@ -160,14 +160,14 @@ int ensure_path_mounted(const char* path) {
strcmp(v->fs_type, "ext3") == 0 ||
strcmp(v->fs_type, "vfat") == 0) {
// try fs type 2 first
- if ((result = try_mount(v->device, v->mount_point, v->fs_type2)) == 0)
- return 0;
- if ((result = try_mount(v->device2, v->mount_point, v->fs_type2)) == 0)
- return 0;
if ((result = try_mount(v->device, v->mount_point, v->fs_type)) == 0)
return 0;
if ((result = try_mount(v->device2, v->mount_point, v->fs_type)) == 0)
return 0;
+ if ((result = try_mount(v->device, v->mount_point, v->fs_type2)) == 0)
+ return 0;
+ if ((result = try_mount(v->device2, v->mount_point, v->fs_type2)) == 0)
+ return 0;
return result;
} else {
// let's try mounting with the mount binary and hope for the best.