+2002-06-03 Christopher Faylor <cgf@redhat.com>
+
+ * fhandler.cc (fhandler_base::open): Don't set binmode if already set.
+ Don't check for file. Files should already be set. Report on binary
+ mode for debugging.
+ (fhandler_base::fhandler_base): Don't set default binmode here. That's
+ for later.
+ * fhandler_console.cc (fhandler_console::output_tcsetattr): Don't set
+ binmode, ever, for console.
+ * fhandler_disk_file.cc (fhandler_disk_file::open): Always set the
+ binary mode to the value derived from mount table.
+ * path.cc (mount_info::conv_to_win32_path): Default to binmode if path
+ does not translate into anything in the mount table.
+
2002-06-03 Corinna Vinschen <corinna@vinschen.de>
* external.cc (cygwin_internal): Add CW_EXTRACT_DOMAIN_AND_USER
set_file_attribute (has_acls (), get_win32_name (), mode);
set_io_handle (x);
- int bin;
- int fmode;
- if ((bin = flags & (O_BINARY | O_TEXT)))
- /* nothing to do */;
- else if ((fmode = get_default_fmode (flags)) & O_BINARY)
- bin = O_BINARY;
- else if (fmode & O_TEXT)
- bin = O_TEXT;
- else if (get_device () == FH_DISK)
- bin = get_w_binary () || get_r_binary () || 1;
+ if (get_w_binset () && get_r_binset ())
+ syscall_printf ("filemode already set to %d/%d", get_r_binary (), get_w_binary ());
else
- bin = get_w_binary () || get_r_binary () || (binmode != O_TEXT);
+ {
+ int bin;
+ int fmode;
+ if ((bin = flags & (O_BINARY | O_TEXT)))
+ /* nothing to do */;
+ else if ((fmode = get_default_fmode (flags)) & O_BINARY)
+ bin = O_BINARY;
+ else if (fmode & O_TEXT)
+ bin = O_TEXT;
+ else
+ bin = get_w_binary () || get_r_binary () || (binmode != O_TEXT);
- if (bin & O_TEXT)
- bin = 0;
+ if (bin & O_TEXT)
+ bin = 0;
- set_flags (flags | (bin ? O_BINARY : O_TEXT));
+ set_flags (flags | (bin ? O_BINARY : O_TEXT));
- set_r_binary (bin);
- set_w_binary (bin);
- syscall_printf ("filemode set to %s", bin ? "binary" : "text");
+ set_r_binary (bin);
+ set_w_binary (bin);
+ syscall_printf ("filemode set to %s", bin ? "binary" : "text");
+ }
res = 1;
set_open_status ();
oflags = O_RDWR;
set_flags (oflags | (bin ? O_BINARY : O_TEXT));
set_open_status ();
- debug_printf ("created new fhandler_base for handle %p", f);
+ debug_printf ("created new fhandler_base for handle %p, bin %d", f, get_r_binary ());
}
void
win32_path_name (NULL),
open_status (0)
{
+#if 0
int bin = __fmode & O_TEXT ? 0 : 1;
if (status != FH_DISK && status != FH_CONSOLE)
{
if (!get_w_binset ())
set_w_binary (bin);
}
+#endif
}
/* Normal I/O destructor */