diff options
author | Christopher Faylor <me@cgf.cx> | 2002-10-18 01:28:48 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-10-18 01:28:48 +0000 |
commit | abb58a6d3f5af3ab5badea554280d36113fa1349 (patch) | |
tree | 3cb2231d32b31e89580d52880df32e9be0187df3 /winsup/cygwin/dtable.cc | |
parent | fef1edbc9a4ca63fdb801f78086d442bce1da40f (diff) | |
download | cygnal-abb58a6d3f5af3ab5badea554280d36113fa1349.tar.gz cygnal-abb58a6d3f5af3ab5badea554280d36113fa1349.tar.bz2 cygnal-abb58a6d3f5af3ab5badea554280d36113fa1349.zip |
* dtable.cc (dtable::init_std_file_from_handle): Force "devices" to always be
in binary mode. Temporary fix until ssh is rebuilt?
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r-- | winsup/cygwin/dtable.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 7bbfbbfb7..9c363aaa5 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -220,6 +220,7 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle) struct sockaddr sa; int sal = sizeof (sa); DCB dcb; + unsigned bin = O_BINARY; first_fd_for_open = 0; @@ -259,7 +260,10 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle) else if (GetCommState (handle, &dcb)) name = "/dev/ttyS0"; // FIXME - determine correct device else - name = handle_to_fn (handle, (char *) alloca (MAX_PATH + 100)); + { + name = handle_to_fn (handle, (char *) alloca (MAX_PATH + 100)); + bin = 0; + } } if (!name) @@ -267,11 +271,13 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle) else { path_conv pc; - unsigned bin; fhandler_base *fh = build_fhandler_from_name (fd, name, handle, pc); - bin = fh->get_default_fmode (O_RDWR); - if (!bin && name != unknown_file) - bin = pc.binmode (); + if (!bin) + { + bin = fh->get_default_fmode (O_RDWR); + if (!bin && name != unknown_file) + bin = pc.binmode (); + } fh->init (handle, GENERIC_READ | GENERIC_WRITE, bin); set_std_handle (fd); |