]> sourceware.org Git - newlib-cygwin.git/commitdiff
* dtable.cc (dtable::init_std_file_from_handle): Force "devices" to always be
authorChristopher Faylor <me@cgf.cx>
Fri, 18 Oct 2002 01:28:48 +0000 (01:28 +0000)
committerChristopher Faylor <me@cgf.cx>
Fri, 18 Oct 2002 01:28:48 +0000 (01:28 +0000)
in binary mode.  Temporary fix until ssh is rebuilt?

winsup/cygwin/ChangeLog
winsup/cygwin/dtable.cc

index f51f0a448f5cd81a4f329988a93ed0c29d7fb74b..28fdf96dff1f99400d4cb436018717699d9e1111 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-17  Christopher Faylor  <cgf@redhat.com>
+
+       * dtable.cc (dtable::init_std_file_from_handle): Force "devices" to
+       always be in binary mode.  Temporary fix until ssh is rebuilt?
+
 2002-10-17  Christopher Faylor  <cgf@redhat.com>
 
        * dtable.cc (dtable::set_file_pointers_for_exec): New function.
index 7bbfbbfb7b31e16cccdb461272f2e4f7a60d2282..9c363aaa5c8e446d6934e417f3bf406a611af1b4 100644 (file)
@@ -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);
This page took 0.039228 seconds and 5 git commands to generate.