summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler_tty.cc8
2 files changed, 10 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a0db4f494..cc3937081 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 0629f2d3f..377a875fa 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -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;
}