aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-11-14 02:15:23 +0000
committerChristopher Faylor <me@cgf.cx>2002-11-14 02:15:23 +0000
commita2dea5c33349d4c5b2c0dfc410ae7536e36c0fac (patch)
treeaf13ef17d94217da90cf80c30d6b7d35e90b9c7e
parent40e4147f4e6523b9acbfc8e2594cd3fa7fada2a4 (diff)
downloadnewlib-a2dea5c33349d4c5b2c0dfc410ae7536e36c0fac.zip
newlib-a2dea5c33349d4c5b2c0dfc410ae7536e36c0fac.tar.gz
newlib-a2dea5c33349d4c5b2c0dfc410ae7536e36c0fac.tar.bz2
* ioctl.cc (ioctl): Always print ioctl results, even when it's a tty.
* winsup.h (low_priority_sleep): Declare.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/ioctl.cc17
2 files changed, 20 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b36bd80..5b63159 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,13 @@
2002-11-13 Christopher Faylor <cgf@redhat.com>
+ * ioctl.cc (ioctl): Always print ioctl results, even when it's a tty.
+
+2002-11-13 Christopher Faylor <cgf@redhat.com>
+
+ * winsup.h (low_priority_sleep): Declare.
+
+2002-11-13 Christopher Faylor <cgf@redhat.com>
+
* miscfuncs.cc (low_priority_sleep): New function. Use throughout
where code is supposed to be giving up time slice.
diff --git a/winsup/cygwin/ioctl.cc b/winsup/cygwin/ioctl.cc
index e15d544..9f219ec 100644
--- a/winsup/cygwin/ioctl.cc
+++ b/winsup/cygwin/ioctl.cc
@@ -39,20 +39,27 @@ ioctl (int fd, int cmd, ...)
va_end (ap);
debug_printf ("fd %d, cmd %x", fd, cmd);
+ int res;
if (cfd->is_tty () && cfd->get_device () != FH_PTYM)
switch (cmd)
{
case TCGETA:
- return tcgetattr (fd, (struct termios *) argp);
+ res = tcgetattr (fd, (struct termios *) argp);
+ goto out;
case TCSETA:
- return tcsetattr (fd, TCSANOW, (struct termios *) argp);
+ res = tcsetattr (fd, TCSANOW, (struct termios *) argp);
+ goto out;
case TCSETAW:
- return tcsetattr (fd, TCSADRAIN, (struct termios *) argp);
+ res = tcsetattr (fd, TCSADRAIN, (struct termios *) argp);
+ goto out;
case TCSETAF:
- return tcsetattr (fd, TCSAFLUSH, (struct termios *) argp);
+ res = tcsetattr (fd, TCSAFLUSH, (struct termios *) argp);
+ goto out;
}
- int res = cfd->ioctl (cmd, argp);
+ res = cfd->ioctl (cmd, argp);
+
+out:
debug_printf ("returning %d", res);
return res;
}