diff options
author | Christopher Faylor <me@cgf.cx> | 2000-07-28 22:34:24 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-07-28 22:34:24 +0000 |
commit | 959e1bac1366264d836d298589d5ea8d24bb675f (patch) | |
tree | 9050fa860ce9e906f8a43ec90527f35e2a1554f5 /winsup/utils/umount.cc | |
parent | 637f5ce0fecddfb14d8f0b6a12d791fac469ad84 (diff) | |
download | cygnal-959e1bac1366264d836d298589d5ea8d24bb675f.tar.gz cygnal-959e1bac1366264d836d298589d5ea8d24bb675f.tar.bz2 cygnal-959e1bac1366264d836d298589d5ea8d24bb675f.zip |
* utils/mount.cc (main): Add --show-cygdrive-prefixes option.
(show_cygdrive_prefixes): New function.
* utils/umount.cc (main): Add --remove-cygdrive-prefix option.
(error): Change signature from 'char *' to 'const char *'.
(remove_cygdrive_prefix): New function.
Diffstat (limited to 'winsup/utils/umount.cc')
-rw-r--r-- | winsup/utils/umount.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/winsup/utils/umount.cc b/winsup/utils/umount.cc index 7623c5f97..d79aaca33 100644 --- a/winsup/utils/umount.cc +++ b/winsup/utils/umount.cc @@ -19,6 +19,7 @@ static void remove_all_mounts (); static void remove_all_automounts (); static void remove_all_user_mounts (); static void remove_all_system_mounts (); +static void remove_cygdrive_prefix (int flags); static const char *progname; @@ -31,12 +32,13 @@ usage (void) fprintf (stderr, "--remove-all-mounts = remove all mounts\n"); fprintf (stderr, "--remove-auto-mounts = remove all automatically mounted mounts\n"); fprintf (stderr, "--remove-user-mounts = remove all mounts in the current user mount registry area, including auto mounts\n"); - fprintf (stderr, "--remove-system-mounts = Remove all mounts in the system-wide mount registry area\n"); + fprintf (stderr, "--remove-system-mounts = remove all mounts in the system-wide mount registry area\n"); + fprintf (stderr, "[-s] --remove-cygdrive-prefix = remove cygdrive path prefix\n"); exit (1); } static void -error (char *path) +error (const char *path) { fprintf (stderr, "%s: %s: %s\n", progname, path, strerror (errno)); exit (1); @@ -81,6 +83,11 @@ main (int argc, char **argv) remove_all_automounts (); exit (0); } + else if (strcmp (argv[i], "--remove-cygdrive-prefix") == 0) + { + remove_cygdrive_prefix (flags); + exit (0); + } else usage (); } @@ -182,3 +189,12 @@ remove_all_system_mounts () endmntent (m); } + +/* remove_cygdrive_prefix: Remove cygdrive user or system path prefix. */ +static void +remove_cygdrive_prefix (int flags) +{ + int res = cygwin_umount(NULL, flags | MOUNT_AUTO); + if (res) + error ("remove_cygdrive_prefix"); +} |