diff options
author | Christopher Faylor <me@cgf.cx> | 2002-06-01 02:53:25 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-06-01 02:53:25 +0400 |
commit | 8e74c3207f2f92b4ce5b2f2a030d639e1745d6b6 (patch) | |
tree | 5fdb7c5dae4c688c6a38ce1b51b4d724615d0705 /winsup | |
parent | de86e35bc42919388be659124c6e80655f8c23d4 (diff) |
* fhandler_console.cc (fhandler_console::open): Reinstate setting of flags.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/dtable.cc | 7 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.h | 4 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 2 |
7 files changed, 16 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 94c3ade58..9b2028374 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2002-05-31 Christopher Faylor <cgf@redhat.com> + * fhandler_console.cc (fhandler_console::open): Reinstate setting of + flags. + +2002-05-31 Christopher Faylor <cgf@redhat.com> + * fhandler_console.cc (fhandler_console::open): Always default to binmode. (fhandler_console::write_normal): Don't honor binmode setting. There diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 028a5f879..e52e6dd00 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -217,7 +217,7 @@ cygwin_attach_handle_to_fd (char *name, int fd, HANDLE handle, mode_t bin, void dtable::init_std_file_from_handle (int fd, HANDLE handle, DWORD myaccess) { - int bin = 0; + int bin = -1; const char *name; CONSOLE_SCREEN_BUFFER_INFO buf; struct sockaddr sa; @@ -238,7 +238,7 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle, DWORD myaccess) if (__fmode) bin = __fmode; else - bin = binmode ?: 0; + bin = (int) binmode ?: -1; /* See if we can consoleify it - if it is a console, don't open it in binary. That will screw up our crlfs*/ @@ -280,7 +280,8 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle, DWORD myaccess) else { path_conv pc; - build_fhandler_from_name (fd, name, handle, pc)->init (handle, myaccess, bin); + build_fhandler_from_name (fd, name, handle, pc)->init (handle, myaccess, + bin < 0 ? pc.isbinary () : bin); set_std_handle (fd); paranoid_printf ("fd %d, handle %p", fd, handle); } diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 00a8e0b0b..014857023 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1169,3 +1169,5 @@ fhandler_base::closedir (DIR *) set_errno (ENOTDIR); return -1; } +bool fhandler_base::get_w_binary () { return FHISSETF (WBINSET) ? FHISSETF (WBINARY) : 1; } +bool fhandler_base::get_r_binary () { return FHISSETF (RBINSET) ? FHISSETF (RBINARY) : 1; } diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 91ac5cc09..31b540619 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -179,8 +179,8 @@ class fhandler_base bool is_nonblocking (); void set_nonblocking (int yes); - bool get_w_binary () { return FHISSETF (WBINARY); } - bool get_r_binary () { return FHISSETF (RBINARY); } + bool get_w_binary () { return FHISSETF (WBINSET) ? FHISSETF (WBINARY) : 1; } + bool get_r_binary () { return FHISSETF (RBINSET) ? FHISSETF (RBINARY) : 1; } bool get_w_binset () { return FHISSETF (WBINSET); } bool get_r_binset () { return FHISSETF (RBINSET); } diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 957dd4662..ac4f9ba68 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -547,6 +547,7 @@ fhandler_console::open (path_conv *, int flags, mode_t) set_io_handle (INVALID_HANDLE_VALUE); set_output_handle (INVALID_HANDLE_VALUE); + set_flags (flags); set_w_binary (1); set_r_binary (1); diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 5c266ee0b..2548ce6f0 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -63,7 +63,7 @@ num_entries (const char *win32_name) int __stdcall fhandler_disk_file::fstat_by_handle (struct __stat64 *buf, path_conv *pc) { - int res; + int res = 0; BY_HANDLE_FILE_INFORMATION local; /* NT 3.51 seems to have a bug when attempting to get vol serial diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 9aa968b78..034926aa8 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -741,7 +741,6 @@ out: if (tail[1] != '\0') *tail = '/'; normalized_path = cstrdup (path_copy); - debug_printf ("path_copy %s", path_copy); } /* Deal with Windows stupidity which considers filename\. to be valid even when "filename" is not a directory. */ @@ -814,6 +813,7 @@ out: path_flags |= PATH_EXEC; } + debug_printf ("binary %d", isbinary ()); #if 0 if (!error) { |