Fix indenting.

Fix a bug noticed by Pete Flugstad.  Make certain we close what we open, and
don't try to close invalid files when /etc/filesystems exists and is used.
This commit is contained in:
Eric Andersen 2003-12-09 23:50:24 +00:00
parent 747f2f7d78
commit d5c746f3a8

View File

@ -273,8 +273,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType,
filesystemType = buf; filesystemType = buf;
if (bb_strlen(filesystemType)) { if (bb_strlen(filesystemType)) {
status = status = do_mount(blockDevice, directory, filesystemType,
do_mount(blockDevice, directory, filesystemType,
flags | MS_MGC_VAL, string_flags, flags | MS_MGC_VAL, string_flags,
useMtab, fakeIt, mtab_opts, mount_all); useMtab, fakeIt, mtab_opts, mount_all);
if (status) { if (status) {
@ -287,7 +286,8 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType,
fclose(f); fclose(f);
} }
if ((!f || read_proc) && !status) { if (read_proc && !status) {
f = bb_xfopen("/proc/filesystems", "r"); f = bb_xfopen("/proc/filesystems", "r");
while (fgets(buf, sizeof(buf), f) != NULL) { while (fgets(buf, sizeof(buf), f) != NULL) {
@ -303,8 +303,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType,
filesystemType = buf; filesystemType = buf;
filesystemType++; /* hop past tab */ filesystemType++; /* hop past tab */
status = status = do_mount(blockDevice, directory, filesystemType,
do_mount(blockDevice, directory, filesystemType,
flags | MS_MGC_VAL, string_flags, useMtab, flags | MS_MGC_VAL, string_flags, useMtab,
fakeIt, mtab_opts, mount_all); fakeIt, mtab_opts, mount_all);
if (status) { if (status) {
@ -312,8 +311,8 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType,
} }
} }
} }
}
fclose(f); fclose(f);
}
} else { } else {
status = status =
do_mount(blockDevice, directory, filesystemType, do_mount(blockDevice, directory, filesystemType,