diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-09-10 18:38:17 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-09-10 18:38:17 +0000 |
commit | 39e93cc95148536eb42b577980f912cbe3888a9b (patch) | |
tree | 7f077cca5f48c852e639c166bbe3501ddd4db708 /util-linux/mount.c | |
parent | 2244a21a8e11736516caf6b239ae108768f9390d (diff) | |
download | busybox-w32-39e93cc95148536eb42b577980f912cbe3888a9b.tar.gz busybox-w32-39e93cc95148536eb42b577980f912cbe3888a9b.tar.bz2 busybox-w32-39e93cc95148536eb42b577980f912cbe3888a9b.zip |
nfsmount: nfsmount.h merged into nfsmount.c
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r-- | util-linux/mount.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index e76c7db99..b1d9e287d 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -92,9 +92,9 @@ struct { | |||
92 | static void append_mount_options(char **oldopts, char *newopts) | 92 | static void append_mount_options(char **oldopts, char *newopts) |
93 | { | 93 | { |
94 | if(*oldopts && **oldopts) { | 94 | if(*oldopts && **oldopts) { |
95 | char *temp=xasprintf("%s,%s",*oldopts,newopts); | 95 | char *temp = xasprintf("%s,%s",*oldopts,newopts); |
96 | free(*oldopts); | 96 | free(*oldopts); |
97 | *oldopts=temp; | 97 | *oldopts = temp; |
98 | } else { | 98 | } else { |
99 | if (ENABLE_FEATURE_CLEAN_UP) free(*oldopts); | 99 | if (ENABLE_FEATURE_CLEAN_UP) free(*oldopts); |
100 | *oldopts = xstrdup(newopts); | 100 | *oldopts = xstrdup(newopts); |
@@ -346,13 +346,14 @@ static int singlemount(struct mntent *mp, int ignore_busy) | |||
346 | default: | 346 | default: |
347 | bb_error_msg( errno == EPERM || errno == EACCES | 347 | bb_error_msg( errno == EPERM || errno == EACCES |
348 | ? bb_msg_perm_denied_are_you_root | 348 | ? bb_msg_perm_denied_are_you_root |
349 | : "Couldn't setup loop device"); | 349 | : "cannot setup loop device"); |
350 | return errno; | 350 | return errno; |
351 | } | 351 | } |
352 | 352 | ||
353 | // Autodetect bind mounts | 353 | // Autodetect bind mounts |
354 | 354 | ||
355 | } else if (S_ISDIR(st.st_mode) && !mp->mnt_type) vfsflags |= MS_BIND; | 355 | } else if (S_ISDIR(st.st_mode) && !mp->mnt_type) |
356 | vfsflags |= MS_BIND; | ||
356 | } | 357 | } |
357 | 358 | ||
358 | /* If we know the fstype (or don't need to), jump straight | 359 | /* If we know the fstype (or don't need to), jump straight |
@@ -399,7 +400,7 @@ report_error: | |||
399 | 400 | ||
400 | if (rc && errno == EBUSY && ignore_busy) rc = 0; | 401 | if (rc && errno == EBUSY && ignore_busy) rc = 0; |
401 | if (rc < 0) | 402 | if (rc < 0) |
402 | bb_perror_msg("Mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir); | 403 | bb_perror_msg("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir); |
403 | 404 | ||
404 | return rc; | 405 | return rc; |
405 | } | 406 | } |
@@ -466,7 +467,7 @@ int mount_main(int argc, char **argv) | |||
466 | if (!all) { | 467 | if (!all) { |
467 | FILE *mountTable = setmntent(bb_path_mtab_file, "r"); | 468 | FILE *mountTable = setmntent(bb_path_mtab_file, "r"); |
468 | 469 | ||
469 | if(!mountTable) bb_error_msg_and_die("No %s",bb_path_mtab_file); | 470 | if(!mountTable) bb_error_msg_and_die("no %s",bb_path_mtab_file); |
470 | 471 | ||
471 | while (getmntent_r(mountTable,mtpair,bb_common_bufsiz1, | 472 | while (getmntent_r(mountTable,mtpair,bb_common_bufsiz1, |
472 | sizeof(bb_common_bufsiz1))) | 473 | sizeof(bb_common_bufsiz1))) |
@@ -514,7 +515,7 @@ int mount_main(int argc, char **argv) | |||
514 | else fstabname="/etc/fstab"; | 515 | else fstabname="/etc/fstab"; |
515 | 516 | ||
516 | if (!(fstab=setmntent(fstabname,"r"))) | 517 | if (!(fstab=setmntent(fstabname,"r"))) |
517 | bb_perror_msg_and_die("Cannot read %s",fstabname); | 518 | bb_perror_msg_and_die("cannot read %s",fstabname); |
518 | 519 | ||
519 | // Loop through entries until we find what we're looking for. | 520 | // Loop through entries until we find what we're looking for. |
520 | 521 | ||
@@ -535,7 +536,7 @@ int mount_main(int argc, char **argv) | |||
535 | // If we didn't find anything, complain. | 536 | // If we didn't find anything, complain. |
536 | 537 | ||
537 | if (!mtnext->mnt_fsname) | 538 | if (!mtnext->mnt_fsname) |
538 | bb_error_msg_and_die("Can't find %s in %s", | 539 | bb_error_msg_and_die("can't find %s in %s", |
539 | argv[optind], fstabname); | 540 | argv[optind], fstabname); |
540 | 541 | ||
541 | // Mount the last thing we found. | 542 | // Mount the last thing we found. |