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:
authorChristopher Faylor <me@cgf.cx>2002-06-01 02:53:25 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-01 02:53:25 +0400
commit8e74c3207f2f92b4ce5b2f2a030d639e1745d6b6 (patch)
tree5fdb7c5dae4c688c6a38ce1b51b4d724615d0705 /winsup/cygwin/dtable.cc
parentde86e35bc42919388be659124c6e80655f8c23d4 (diff)
* fhandler_console.cc (fhandler_console::open): Reinstate setting of flags.
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc7
1 files changed, 4 insertions, 3 deletions
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);
}