From bf827fd801c76175d268b688f3bf9c757fa9e189 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Fri, 5 Jul 2013 17:13:29 +0200 Subject: mount: ignore mounted filesystems if --all is given Linux' mount utility ignores mounted filesystems if mount --all is invoked. This patch makes our mount do the same. utils/mount.c (main): Ignore mounted filesystems if --all is given. --- utils/mount.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'utils/mount.c') diff --git a/utils/mount.c b/utils/mount.c index 73a75391..77b2138e 100644 --- a/utils/mount.c +++ b/utils/mount.c @@ -631,6 +631,15 @@ main (int argc, char **argv) if (! match_options (&fs->mntent)) continue; + + fsys_t mounted; + err = fs_fsys (fs, &mounted); + if (err) + error (0, err, "cannot determine if %s is already mounted", + fs->mntent.mnt_fsname); + + if (mounted != MACH_PORT_NULL) + continue; } err |= do_mount (fs, remount); } -- cgit v1.2.3