diff options
| author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-12-09 23:50:24 +0000 |
|---|---|---|
| committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-12-09 23:50:24 +0000 |
| commit | 7dd402e4ec2a61305783ed71456e7ace3d94fa9c (patch) | |
| tree | 0c2948bb0c703f72717958941790be3eee5110e2 /util-linux | |
| parent | bca1dbe7b83648c8a528ee3b6a67382c160a1a7f (diff) | |
| download | busybox-w32-7dd402e4ec2a61305783ed71456e7ace3d94fa9c.tar.gz busybox-w32-7dd402e4ec2a61305783ed71456e7ace3d94fa9c.tar.bz2 busybox-w32-7dd402e4ec2a61305783ed71456e7ace3d94fa9c.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.
git-svn-id: svn://busybox.net/trunk/busybox@8061 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux')
| -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, |
