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:
Diffstat (limited to 'winsup/cygwin/ioctl.cc')
-rw-r--r--winsup/cygwin/ioctl.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/winsup/cygwin/ioctl.cc b/winsup/cygwin/ioctl.cc
index e15d54437..9f219ecd6 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;
}