Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-08-11 15:01:14 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-08-11 15:01:14 +0400
commit68a178b37ca1fb6c05b508a92314c22a00f6ebd9 (patch)
treed69b1ec4aed7d93dc1edeee4a2f2e5f01d805fdd /winsup/utils/mount.cc
parenta5fe426282c0586415642baf7fb0c880f5f163de (diff)
* mount.cc (do_mount): Don't treat "bind" mount as remote mount.
(mount_entries): Drop the "bind" option from output. * utils.sgml (mount): Match examples to actual mount output. Add "bind" option and add example.
Diffstat (limited to 'winsup/utils/mount.cc')
-rw-r--r--winsup/utils/mount.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/winsup/utils/mount.cc b/winsup/utils/mount.cc
index 3e342af5d..be6ad03d0 100644
--- a/winsup/utils/mount.cc
+++ b/winsup/utils/mount.cc
@@ -86,7 +86,7 @@ do_mount (const char *dev, const char *where, int flags)
fprintf (stderr, "%s: warning: %s is not a directory.\n", progname, where);
}
- if (!force && !(flags & EXEC_FLAGS) && strlen (dev))
+ if (!force && !(flags & (EXEC_FLAGS | MOUNT_BIND)) && strlen (dev))
{
char devtmp[1 + 2 * strlen (dev)];
strcpy (devtmp, dev);
@@ -426,10 +426,14 @@ mount_entries (void)
// write fstab entries for normal mount points
while ((p = getmntent (m)) != NULL)
- // Only list non-cygdrives
+ // Only list non-cygdrives and non-automounts
if (!strstr (p->mnt_opts, ",noumount") && !strstr (p->mnt_opts, ",auto"))
{
char fsname[NT_MAX_PATH], dirname[NT_MAX_PATH];
+ /* Drop the "bind" option since it can't be reverted. */
+ char *c = strstr (p->mnt_opts, ",bind");
+ if (c)
+ memmove (c, c + 5, strlen (c + 5) + 1);
printf (format_mnt, convert_spaces (fsname, p->mnt_fsname),
convert_spaces (dirname, p->mnt_dir),
p->mnt_type, p->mnt_opts);