* 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.
This commit is contained in:
Corinna Vinschen
2010-08-11 11:01:14 +00:00
parent a5fe426282
commit 68a178b37c
3 changed files with 46 additions and 18 deletions

View File

@ -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);