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>2003-10-24 05:13:22 +0400
committerChristopher Faylor <me@cgf.cx>2003-10-24 05:13:22 +0400
commite64a50ed4e8ac5a57c1728b17ff24f866a9ad6cf (patch)
tree59bdc94b4eba5dc2adf976c8d66b2a8471ca7ec6
parent3ef05bac2186796b243975c501ae824328389f94 (diff)
* fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set return value in
FIONBIO case.
-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;
}