diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-12-09 23:50:24 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-12-09 23:50:24 +0000 |
commit | d5c746f3a8afa86cf9e068527a728f8ae8dade00 (patch) | |
tree | 0c2948bb0c703f72717958941790be3eee5110e2 /util-linux/mount.c | |
parent | 747f2f7d786c4090c376f25f2db8146310e4c3a2 (diff) | |
download | busybox-w32-d5c746f3a8afa86cf9e068527a728f8ae8dade00.tar.gz busybox-w32-d5c746f3a8afa86cf9e068527a728f8ae8dade00.tar.bz2 busybox-w32-d5c746f3a8afa86cf9e068527a728f8ae8dade00.zip |
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, | |||
273 | filesystemType = buf; | 273 | filesystemType = buf; |
274 | 274 | ||
275 | if (bb_strlen(filesystemType)) { | 275 | if (bb_strlen(filesystemType)) { |
276 | status = | 276 | status = do_mount(blockDevice, directory, filesystemType, |
277 | do_mount(blockDevice, directory, filesystemType, | ||
278 | flags | MS_MGC_VAL, string_flags, | 277 | flags | MS_MGC_VAL, string_flags, |
279 | useMtab, fakeIt, mtab_opts, mount_all); | 278 | useMtab, fakeIt, mtab_opts, mount_all); |
280 | if (status) { | 279 | if (status) { |
@@ -287,7 +286,8 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
287 | fclose(f); | 286 | fclose(f); |
288 | } | 287 | } |
289 | 288 | ||
290 | if ((!f || read_proc) && !status) { | 289 | if (read_proc && !status) { |
290 | |||
291 | f = bb_xfopen("/proc/filesystems", "r"); | 291 | f = bb_xfopen("/proc/filesystems", "r"); |
292 | 292 | ||
293 | while (fgets(buf, sizeof(buf), f) != NULL) { | 293 | while (fgets(buf, sizeof(buf), f) != NULL) { |
@@ -303,8 +303,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
303 | filesystemType = buf; | 303 | filesystemType = buf; |
304 | filesystemType++; /* hop past tab */ | 304 | filesystemType++; /* hop past tab */ |
305 | 305 | ||
306 | status = | 306 | status = do_mount(blockDevice, directory, filesystemType, |
307 | do_mount(blockDevice, directory, filesystemType, | ||
308 | flags | MS_MGC_VAL, string_flags, useMtab, | 307 | flags | MS_MGC_VAL, string_flags, useMtab, |
309 | fakeIt, mtab_opts, mount_all); | 308 | fakeIt, mtab_opts, mount_all); |
310 | if (status) { | 309 | if (status) { |
@@ -312,8 +311,8 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
312 | } | 311 | } |
313 | } | 312 | } |
314 | } | 313 | } |
314 | fclose(f); | ||
315 | } | 315 | } |
316 | fclose(f); | ||
317 | } else { | 316 | } else { |
318 | status = | 317 | status = |
319 | do_mount(blockDevice, directory, filesystemType, | 318 | do_mount(blockDevice, directory, filesystemType, |