]> sourceware.org Git - newlib-cygwin.git/commitdiff
* fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set return value in
authorChristopher Faylor <me@cgf.cx>
Fri, 24 Oct 2003 01:13:22 +0000 (01:13 +0000)
committerChristopher Faylor <me@cgf.cx>
Fri, 24 Oct 2003 01:13:22 +0000 (01:13 +0000)
FIONBIO case.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_tty.cc

index a0db4f4941571b460f7400a93adf8fccaf213adc..cc3937081410a2f0004132d53c530900226a2d6b 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-23  Christopher Faylor  <cgf@redhat.com>
+
+       * fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set return
+       value in FIONBIO case.
+
 2003-10-23  Corinna Vinschen  <corinna@vinschen.de>
 
        * fhandler_proc.cc (format_proc_partitions): Use new device code
index 0629f2d3f73ff2bd0025072f81fadf1b03f80740..377a875fa57319a9e325d3ac6a226c2435383bf2 100644 (file)
@@ -1025,6 +1025,7 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
       raise (SIGTTOU);
     }
 
+  int retval;
   switch (cmd)
     {
     case TIOCGWINSZ:
@@ -1033,6 +1034,7 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
       break;
     case FIONBIO:
       set_nonblocking (*(int *) arg);
+      retval = 0;
       goto out;
     default:
       set_errno (EINVAL);
@@ -1086,14 +1088,14 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
     }
 
   release_output_mutex ();
-
-out:
-  int retval = get_ttyp ()->ioctl_retval;
+  retval = get_ttyp ()->ioctl_retval;
   if (retval < 0)
     {
       set_errno (-retval);
       retval = -1;
     }
+
+out:
   termios_printf ("%d = ioctl (%x)", retval, cmd);
   return retval;
 }
This page took 0.037659 seconds and 5 git commands to generate.