* fhandler_clipboard.c (fhandler_dev_clipboard::open): Force text mode.

* fhandler_console.cc (fhandler_console::open): *Really* force binary mode
rather than make it optional.
* fhandler_proc.cc (fhandler_proc::open): Ditto.
* fhandler_process.cc (fhandler_process::open): Ditto.
* fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
* fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
* fhandler_registry.cc (fhandler_registry::open): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
* fhandler_virtual.cc (fhandler_virtual::open): Ditto.
* fhandler_windows.cc (fhandler_windows::open): Ditto.
* fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
* net.cc (fdsock): Ditto.
* path.cc (set_flags): Add more debugging.
This commit is contained in:
Christopher Faylor 2002-07-01 19:03:26 +00:00
parent ef9647e524
commit 1bc9effd28
14 changed files with 39 additions and 14 deletions

View File

@ -1,3 +1,20 @@
2002-07-01 Christopher Faylor <cgf@redhat.com>
* fhandler_clipboard.c (fhandler_dev_clipboard::open): Force text mode.
* fhandler_console.cc (fhandler_console::open): *Really* force binary
mode rather than make it optional.
* fhandler_proc.cc (fhandler_proc::open): Ditto.
* fhandler_process.cc (fhandler_process::open): Ditto.
* fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
* fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
* fhandler_registry.cc (fhandler_registry::open): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
* fhandler_virtual.cc (fhandler_virtual::open): Ditto.
* fhandler_windows.cc (fhandler_windows::open): Ditto.
* fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
* net.cc (fdsock): Ditto.
* path.cc (set_flags): Add more debugging.
2002-07-01 Christopher Faylor <cgf@redhat.com> 2002-07-01 Christopher Faylor <cgf@redhat.com>
* debug.cc (threads): Avoid initialization. * debug.cc (threads): Avoid initialization.

View File

@ -65,7 +65,7 @@ fhandler_dev_clipboard::dup (fhandler_base * child)
int int
fhandler_dev_clipboard::open (path_conv *, int flags, mode_t) fhandler_dev_clipboard::open (path_conv *, int flags, mode_t)
{ {
set_flags (flags, O_TEXT); set_flags (flags | O_TEXT);
eof = false; eof = false;
pos = 0; pos = 0;
if (membuffer) if (membuffer)

View File

@ -538,7 +538,7 @@ fhandler_console::open (path_conv *, int flags, mode_t)
set_io_handle (INVALID_HANDLE_VALUE); set_io_handle (INVALID_HANDLE_VALUE);
set_output_handle (INVALID_HANDLE_VALUE); set_output_handle (INVALID_HANDLE_VALUE);
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
/* Open the input handle as handle_ */ /* Open the input handle as handle_ */
h = CreateFileA ("CONIN$", GENERIC_READ|GENERIC_WRITE, h = CreateFileA ("CONIN$", GENERIC_READ|GENERIC_WRITE,

View File

@ -300,7 +300,7 @@ fhandler_proc::open (path_conv *pc, int flags, mode_t mode)
success: success:
res = 1; res = 1;
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status (); set_open_status ();
out: out:
syscall_printf ("%d = fhandler_proc::open (%p, %d)", res, flags, mode); syscall_printf ("%d = fhandler_proc::open (%p, %d)", res, flags, mode);

View File

@ -237,7 +237,7 @@ fhandler_process::open (path_conv *pc, int flags, mode_t mode)
success: success:
res = 1; res = 1;
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status (); set_open_status ();
out: out:
syscall_printf ("%d = fhandler_proc::open (%p, %d)", res, flags, mode); syscall_printf ("%d = fhandler_proc::open (%p, %d)", res, flags, mode);

View File

@ -31,7 +31,7 @@ fhandler_dev_random::fhandler_dev_random (int nunit)
int int
fhandler_dev_random::open (path_conv *, int flags, mode_t) fhandler_dev_random::open (path_conv *, int flags, mode_t)
{ {
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status (); set_open_status ();
return 1; return 1;
} }

View File

@ -175,7 +175,7 @@ fhandler_dev_raw::open (path_conv *real_path, int flags, mode_t)
} }
set_io_handle (h); set_io_handle (h);
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
if (devbufsiz > 1L) if (devbufsiz > 1L)
devbuf = new char [devbufsiz]; devbuf = new char [devbufsiz];

View File

@ -480,7 +480,7 @@ fhandler_registry::open (path_conv *pc, int flags, mode_t mode)
success: success:
res = 1; res = 1;
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status (); set_open_status ();
out: out:
if (hKey != (HKEY) INVALID_HANDLE_VALUE) if (hKey != (HKEY) INVALID_HANDLE_VALUE)

View File

@ -454,7 +454,7 @@ fhandler_tty_slave::open (path_conv *, int flags, mode_t)
attach_tty (ttynum); attach_tty (ttynum);
tc->set_ctty (ttynum, flags); tc->set_ctty (ttynum, flags);
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
/* Create synchronisation events */ /* Create synchronisation events */
char buf[40]; char buf[40];
@ -1006,7 +1006,7 @@ fhandler_pty_master::open (path_conv *, int flags, mode_t)
cygwin_shared->tty[ttynum]->common_init (this); cygwin_shared->tty[ttynum]->common_init (this);
inuse = get_ttyp ()->create_inuse (TTY_MASTER_ALIVE); inuse = get_ttyp ()->create_inuse (TTY_MASTER_ALIVE);
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status (); set_open_status ();
termios_printf ("opened pty master tty%d<%p>", ttynum, this); termios_printf ("opened pty master tty%d<%p>", ttynum, this);

View File

@ -207,7 +207,7 @@ fhandler_virtual::open (path_conv *, int flags, mode_t mode)
set_execable_p (not_executable); set_execable_p (not_executable);
set_socket_p (false); set_socket_p (false);
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
set_nohandle (true); set_nohandle (true);

View File

@ -54,7 +54,7 @@ fhandler_windows::fhandler_windows ()
int int
fhandler_windows::open (path_conv *, int flags, mode_t) fhandler_windows::open (path_conv *, int flags, mode_t)
{ {
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
set_close_on_exec_flag (1); set_close_on_exec_flag (1);
set_open_status (); set_open_status ();
return 1; return 1;

View File

@ -23,7 +23,7 @@ fhandler_dev_zero::fhandler_dev_zero ()
int int
fhandler_dev_zero::open (path_conv *, int flags, mode_t) fhandler_dev_zero::open (path_conv *, int flags, mode_t)
{ {
set_flags (flags & ~O_TEXT, O_BINARY); set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status (); set_open_status ();
return 1; return 1;
} }

View File

@ -510,7 +510,7 @@ fdsock (int& fd, const char *name, SOCKET soc)
debug_printf ("not setting socket inheritance since winsock2_active %d", winsock2_active); debug_printf ("not setting socket inheritance since winsock2_active %d", winsock2_active);
fhandler_socket *fh = (fhandler_socket *) cygheap->fdtab.build_fhandler (fd, FH_SOCKET, name); fhandler_socket *fh = (fhandler_socket *) cygheap->fdtab.build_fhandler (fd, FH_SOCKET, name);
fh->set_io_handle ((HANDLE) soc); fh->set_io_handle ((HANDLE) soc);
fh->set_flags (O_RDWR, O_BINARY); fh->set_flags (O_RDWR | O_BINARY);
debug_printf ("fd %d, name '%s', soc %p", fd, name, soc); debug_printf ("fd %d, name '%s', soc %p", fd, name, soc);
return fh; return fh;
} }

View File

@ -1338,7 +1338,15 @@ set_flags (unsigned *flags, unsigned val)
{ {
*flags = val; *flags = val;
if (!(*flags & PATH_BINARY)) if (!(*flags & PATH_BINARY))
*flags = PATH_TEXT; {
*flags |= PATH_TEXT;
debug_printf ("flags: text (%p)", *flags & (PATH_TEXT | PATH_BINARY));
}
else
{
*flags |= PATH_BINARY;
debug_printf ("flags: binary (%p)", *flags & (PATH_TEXT | PATH_BINARY));
}
} }
/* conv_to_win32_path: Ensure src_path is a pure Win32 path and store /* conv_to_win32_path: Ensure src_path is a pure Win32 path and store