diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-12-10 02:50:24 +0300 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-12-10 02:50:24 +0300 |
commit | d5c746f3a8afa86cf9e068527a728f8ae8dade00 (patch) | |
tree | 0c2948bb0c703f72717958941790be3eee5110e2 /util-linux/mount.c | |
parent | 747f2f7d786c4090c376f25f2db8146310e4c3a2 (diff) |
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.
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r-- | util-linux/mount.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index 15a0b5767..43856eace 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -273,8 +273,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, filesystemType = buf; if (bb_strlen(filesystemType)) { - status = - do_mount(blockDevice, directory, filesystemType, + status = do_mount(blockDevice, directory, filesystemType, flags | MS_MGC_VAL, string_flags, useMtab, fakeIt, mtab_opts, mount_all); if (status) { @@ -287,7 +286,8 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, fclose(f); } - if ((!f || read_proc) && !status) { + if (read_proc && !status) { + f = bb_xfopen("/proc/filesystems", "r"); while (fgets(buf, sizeof(buf), f) != NULL) { @@ -303,8 +303,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, filesystemType = buf; filesystemType++; /* hop past tab */ - status = - do_mount(blockDevice, directory, filesystemType, + status = do_mount(blockDevice, directory, filesystemType, flags | MS_MGC_VAL, string_flags, useMtab, fakeIt, mtab_opts, mount_all); if (status) { @@ -312,8 +311,8 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, } } } + fclose(f); } - fclose(f); } else { status = do_mount(blockDevice, directory, filesystemType, |