summaryrefslogtreecommitdiff
path: root/util-linux/mount.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2005-08-14 18:46:34 +0000
committerRob Landley <rob@landley.net>2005-08-14 18:46:34 +0000
commit6e98521d68bdc931ddcbcd80ee299f823ed735f0 (patch)
tree8bd62e2046c79c577fe5d004e43a6cd83a059da5 /util-linux/mount.c
parent58a651b2e59eaeeeb426a58bf8063f860044a2fa (diff)
downloadbusybox-w32-6e98521d68bdc931ddcbcd80ee299f823ed735f0.tar.gz
busybox-w32-6e98521d68bdc931ddcbcd80ee299f823ed735f0.tar.bz2
busybox-w32-6e98521d68bdc931ddcbcd80ee299f823ed735f0.zip
Stephane Billiart noticed that the return code of the new mount was horked.
(Cleaned up the return code path to consistently use numbers so I don't keep confusing EXIT_SUCCESS with TRUE and EXIT_FAILURE with FALSE...)
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r--util-linux/mount.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 924d79d69..c3c13bae4 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -123,7 +123,7 @@ extern int mount_main(int argc, char **argv)
123 *loopFile = 0, *buf = 0, 123 *loopFile = 0, *buf = 0,
124 *files[] = {"/etc/filesystems", "/proc/filesystems", 0}; 124 *files[] = {"/etc/filesystems", "/proc/filesystems", 0};
125 int i, opt, all = FALSE, fakeIt = FALSE, allowWrite = FALSE, 125 int i, opt, all = FALSE, fakeIt = FALSE, allowWrite = FALSE,
126 rc = EXIT_FAILURE, useMtab = ENABLE_FEATURE_MTAB_SUPPORT; 126 rc = 1, useMtab = ENABLE_FEATURE_MTAB_SUPPORT;
127 int flags=0xc0ed0000; // Needed for linux 2.2, ignored by 2.4 and 2.6. 127 int flags=0xc0ed0000; // Needed for linux 2.2, ignored by 2.4 and 2.6.
128 FILE *file = 0,*f = 0; 128 FILE *file = 0,*f = 0;
129 char path[PATH_MAX*2]; 129 char path[PATH_MAX*2];
@@ -284,7 +284,7 @@ singlemount:
284 if(nfsmount(blockDevice, directory, &flags, &string_flags, 1)) 284 if(nfsmount(blockDevice, directory, &flags, &string_flags, 1))
285 bb_perror_msg("nfsmount failed"); 285 bb_perror_msg("nfsmount failed");
286 else { 286 else {
287 rc=EXIT_SUCCESS; 287 rc = 0;
288 fsType="nfs"; 288 fsType="nfs";
289 } 289 }
290 } else { 290 } else {
@@ -380,7 +380,7 @@ mount_it_now:
380 if(ENABLE_FEATURE_CLEAN_UP) free(loopFile); 380 if(ENABLE_FEATURE_CLEAN_UP) free(loopFile);
381 } 381 }
382 // Don't whine about already mounted fs when mounting all. 382 // Don't whine about already mounted fs when mounting all.
383 if(rc<0 && errno == EBUSY && all) rc=0; 383 if(rc<0 && errno == EBUSY && all) rc = 0;
384 else if (errno == EPERM) 384 else if (errno == EPERM)
385 bb_error_msg_and_die(bb_msg_perm_denied_are_you_root); 385 bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
386 } 386 }
@@ -396,5 +396,5 @@ mount_it_now:
396 if(file) endmntent(file); 396 if(file) endmntent(file);
397 if(rc) bb_perror_msg("Mounting %s on %s failed", blockDevice, directory); 397 if(rc) bb_perror_msg("Mounting %s on %s failed", blockDevice, directory);
398 398
399 return rc ? : EXIT_FAILURE; 399 return rc;
400} 400}