This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fhandler_serial fix


The patch fixes a crash when ioctl(fd, TCFLSH, how) is called for a serial
port.

2002-11-03  Sergey Okhapkin  <sos@prospect.com.ru>

        * fhandler_serial.cc (fhandler_serial::ioctl): the 3rd argument of
        ioctl(fd, TCFLSH, ...) is integer but not a pointer.


Index: fhandler_serial.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_serial.cc,v
retrieving revision 1.31
diff -u -p -r1.31 fhandler_serial.cc
--- fhandler_serial.cc  30 Sep 2002 04:35:17 -0000      1.31
+++ fhandler_serial.cc  4 Nov 2002 03:19:55 -0000
@@ -391,6 +391,9 @@ fhandler_serial::ioctl (unsigned int cmd
   int modemStatus;
   int request;

+  if (cmd == TCFLSH)
+    return tcflush ((int) buffer);
+
   request = *(int *) buffer;
   action = 0;
   modemStatus = 0;

Sergey Okhapkin
Somerset, NJ



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]