diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-12-12 22:17:44 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-12-12 22:17:44 +0100 |
commit | 3e97eeb408a1107b0ffacc6ba39682428c4598f1 (patch) | |
tree | f6f7df81821d543bef855f961a76b09e79d49855 /util-linux/mount.c | |
parent | 8cbc300d083001bccac4f33bf61b9dc97f29cb04 (diff) | |
download | busybox-w32-3e97eeb408a1107b0ffacc6ba39682428c4598f1.tar.gz busybox-w32-3e97eeb408a1107b0ffacc6ba39682428c4598f1.tar.bz2 busybox-w32-3e97eeb408a1107b0ffacc6ba39682428c4598f1.zip |
apply post-1.15.2 fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r-- | util-linux/mount.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index 56c32e126..7784681a0 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -1958,6 +1958,7 @@ int mount_main(int argc UNUSED_PARAM, char **argv) | |||
1958 | 1958 | ||
1959 | // If we're mounting all | 1959 | // If we're mounting all |
1960 | } else { | 1960 | } else { |
1961 | struct mntent *mp; | ||
1961 | // No, mount -a won't mount anything, | 1962 | // No, mount -a won't mount anything, |
1962 | // even user mounts, for mere humans | 1963 | // even user mounts, for mere humans |
1963 | if (nonroot) | 1964 | if (nonroot) |
@@ -1985,10 +1986,25 @@ int mount_main(int argc UNUSED_PARAM, char **argv) | |||
1985 | // NFS mounts want this to be xrealloc-able | 1986 | // NFS mounts want this to be xrealloc-able |
1986 | mtcur->mnt_opts = xstrdup(mtcur->mnt_opts); | 1987 | mtcur->mnt_opts = xstrdup(mtcur->mnt_opts); |
1987 | 1988 | ||
1988 | // Mount this thing | 1989 | // If nothing is mounted on this directory... |
1989 | if (singlemount(mtcur, 1)) { | 1990 | // (otherwise repeated "mount -a" mounts everything again) |
1990 | // Count number of failed mounts | 1991 | mp = find_mount_point(mtcur->mnt_dir, /*subdir_too:*/ 0); |
1991 | rc++; | 1992 | // We do not check fsname match of found mount point - |
1993 | // "/" may have fsname of "/dev/root" while fstab | ||
1994 | // says "/dev/something_else". | ||
1995 | if (mp) { | ||
1996 | if (verbose) { | ||
1997 | bb_error_msg("according to %s, " | ||
1998 | "%s is already mounted on %s", | ||
1999 | bb_path_mtab_file, | ||
2000 | mp->mnt_fsname, mp->mnt_dir); | ||
2001 | } | ||
2002 | } else { | ||
2003 | // ...mount this thing | ||
2004 | if (singlemount(mtcur, /*ignore_busy:*/ 1)) { | ||
2005 | // Count number of failed mounts | ||
2006 | rc++; | ||
2007 | } | ||
1992 | } | 2008 | } |
1993 | free(mtcur->mnt_opts); | 2009 | free(mtcur->mnt_opts); |
1994 | } | 2010 | } |