bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4] mount: ignore mounted filesystems if --all is given


From: Justus Winter
Subject: [PATCH 4/4] mount: ignore mounted filesystems if --all is given
Date: Mon, 1 Jul 2013 15:46:54 +0200

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(+)

diff --git a/utils/mount.c b/utils/mount.c
index 07077a5..c3e3475 100644
--- a/utils/mount.c
+++ b/utils/mount.c
@@ -674,6 +674,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);
          }
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]