Cygwin: mount: define binary mount as default

Commit c1023ee353 changed the way
path_conv::binmode() works.  Rather than returning three states,
O_BINARY, O_TEXT, 0, it only returned 2 states, O_BINARY, O_TEXT.  Since
mounts are only binary if they are explicitely mounted binary by setting
the MOUNT_BINARY flag, textmode is default.

This introduced a new bug.  When inheriting stdio HANDLEs from native
Windows processes, the fhandler and its path_conv are created from a
device struct only.  None of the path or mount flags get set this way.
So the mount flags are 0 and path_conv::binmode() returned 0.

After the path_conv::binmode() change it returned O_TEXT since, as
explained above, the default mount mode is textmode.

Rather than just enforcing binary mode for path_conv's created from
device structs, this patch changes the default mount mode to binary:

Replace MOUNT_BINARY flag with MOUNT_TEXT flag with opposite meaning.
Drop all explicit setting of MOUNT_BINARY.  Drop local set_flags
function, it doesn't add any value.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-02-18 10:12:07 +01:00
parent f76c8519ac
commit 367c1ae161
4 changed files with 24 additions and 31 deletions

View File

@@ -22,7 +22,7 @@ extern "C" {
enum
{
MOUNT_BINARY = _BIT ( 1), /* "binary" format read/writes */
MOUNT_TEXT = _BIT ( 0), /* "binary" format read/writes */
MOUNT_SYSTEM = _BIT ( 3), /* mount point came from system table */
MOUNT_EXEC = _BIT ( 4), /* Any file in the mounted directory
gets 'x' bit */