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>2019-01-06 19:44:20 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-01-06 22:30:14 +0300
commitc1023ee353705671aa9a8e4e1179022277add2aa (patch)
treef999d1038b40a48b2b358d3878ab969cd3ed45e6 /winsup/cygwin/mount.cc
parentfde4eaa105912625b6a78fba79d1fc39ee0fd201 (diff)
Cygwin: path_conv: decouple path_types from mount types
- Remove another unfortunate amalgamation: Mount flags (MOUNT_xxx) are converted to path_types (PATH_xxx) and mixed with non-mount path_types flags in the same storage, leading to a tangled, pell-mell usage of mount flags and path flags in path_conv and symlink_info. - There's also the case of PC_NONULLEMPTY. It's used in exactly one place with a path_conv constructor only used in this single place, just to override the automatic PC_NULLEMPTY addition when calling the other path_conv constructors. Crazily, PC_NONULLEMPTY is a define, no path_types flag, despite its name. - It doesn't help that the binary flag exists as mount and path flag, while the text flag only exists as path flag. This leads to mount code using path flags to set text/binary. Very confusing is the fact that a text mount/path flag is not actually required; the mount code sets the text flag on non binary mounts anyway, so there are only two states. However, to puzzle people a bit more, path_conv::binary wrongly implies there's a third, non-binary/non-text state. Clean up this mess: - Store path flags separately from mount flags in path_conv and symlink_info classes and change all checks and testing inline methods accordingly. - Make PC_NONULLEMPTY a simple path_types flag and drop the redundant path_check constructor. - Clean up the definition of pathconv_arg, path_types, and mount flags. Use _BIT expression, newly define in cygwin/bits.h. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/mount.cc')
-rw-r--r--winsup/cygwin/mount.cc17
1 files changed, 4 insertions, 13 deletions
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 1844dd8d0..146b2b6cd 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -524,16 +524,7 @@ static void
set_flags (unsigned *flags, unsigned val)
{
*flags = val;
- if (!(*flags & PATH_BINARY))
- {
- *flags |= PATH_TEXT;
- debug_printf ("flags: text (%y)", *flags & (PATH_TEXT | PATH_BINARY));
- }
- else
- {
- *flags |= PATH_BINARY;
- debug_printf ("flags: binary (%y)", *flags & (PATH_TEXT | PATH_BINARY));
- }
+ debug_printf ("flags: binary (%y)", *flags & MOUNT_BINARY);
}
int
@@ -626,7 +617,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
if (!strchr (src_path + 2, '/'))
{
dev = *netdrive_dev;
- set_flags (flags, PATH_BINARY);
+ set_flags (flags, MOUNT_BINARY);
}
else
{
@@ -647,7 +638,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
dev = fhandler_proc::get_proc_fhandler (src_path);
if (dev == FH_NADA)
return ENOENT;
- set_flags (flags, PATH_BINARY);
+ set_flags (flags, MOUNT_BINARY);
if (isprocsys_dev (dev))
{
if (src_path[procsys_len])
@@ -1008,7 +999,7 @@ mount_info::set_flags_from_win32_path (const char *p)
mi.flags & MOUNT_NOPOSIX))
return mi.flags;
}
- return PATH_BINARY;
+ return MOUNT_BINARY;
}
inline char *