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:
authorChristopher Faylor <me@cgf.cx>2000-07-29 02:34:24 +0400
committerChristopher Faylor <me@cgf.cx>2000-07-29 02:34:24 +0400
commit959e1bac1366264d836d298589d5ea8d24bb675f (patch)
tree9050fa860ce9e906f8a43ec90527f35e2a1554f5 /winsup/utils/mount.cc
parent637f5ce0fecddfb14d8f0b6a12d791fac469ad84 (diff)
* 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/mount.cc')
-rw-r--r--winsup/utils/mount.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/winsup/utils/mount.cc b/winsup/utils/mount.cc
index d7f657c9c..2d1125f91 100644
--- a/winsup/utils/mount.cc
+++ b/winsup/utils/mount.cc
@@ -22,6 +22,7 @@ details. */
#include <errno.h>
static void show_mounts (void);
+static void show_cygdrive_prefixes (void);
static void change_cygdrive_prefix (const char *new_prefix, int flags);
static int mount_already_exists (const char *posix_path, int flags);
@@ -96,6 +97,8 @@ usage (void)
[-bs] --change-cygdrive-prefix <posixpath>
change the cygdrive path prefix to <posixpath>
+--show-cygdrive-prefixes
+ show user and/or system cygdrive path prefixes
--import-old-mounts
copy old registry mount table mounts into the current mount areas
", progname);
@@ -136,6 +139,13 @@ main (int argc, const char **argv)
cygwin_internal (CW_READ_V1_MOUNT_TABLES);
exit (0);
}
+ else if (strcmp (argv[i], "--show-cygdrive-prefixes") == 0)
+ {
+ if ((i + 1) != argc)
+ usage ();
+
+ show_cygdrive_prefixes ();
+ }
else if (strcmp (argv[i], "-b") == 0)
flags |= MOUNT_BINARY;
else if (strcmp (argv[i], "-t") == 0)
@@ -252,3 +262,24 @@ change_cygdrive_prefix (const char *new_prefix, int flags)
exit (0);
}
+
+/* show_cygdrive_prefixes: Show the user and/or cygdrive path prefixes */
+static void
+show_cygdrive_prefixes ()
+{
+ /* Get the Cygdrive user and system path prefixes */
+ char user[MAX_PATH];
+ char system[MAX_PATH];
+ cygwin_internal (CW_GET_CYGDRIVE_PREFIXES, user, system);
+
+ /* Display the user and system cygdrive path prefixes, if necessary
+ (ie, not empty) */
+ const char *format = "%-18s %-11s\n";
+ printf (format, "Prefix", "Type");
+ if (strlen (user) > 0)
+ printf (format, user, "user");
+ if (strlen (system) > 0)
+ printf (format, system, "system");
+
+ exit (0);
+}