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]

Re: More fhandler_serial fixes.


On Tue, Nov 05, 2002 at 05:28:40PM -0500, Christopher Faylor wrote:
>On Tue, Nov 05, 2002 at 04:54:19PM -0500, Sergey Okhapkin wrote:
>>The patch fixes sume bugs/typos in fhandler_serial
>>
>>2002-11-03  Sergey Okhapkin  <sos@prospect.com.ru>
>>
>>        * fhandler_serial.cc (fhandler_serial::raw_read): Use correct type,
>>fix typo.
>>        (fhandler_serial::ioctl): Fix ClearCommError() return value check,
>>         set errno if the call failed.
>>         Don't give up if DeviceIoCtl() failed, but fall back to Win95
>>method.
>>        (fhandler_serial::tcsetattr): Use correct value for vmin_.
>>        (fhandler_serial::tcgetattr): Ditto.
>
>Is there any way that you could send this as regular text or even as an
>attachment.  It's hard to respond to patches when they're uunencoded.

Responding to decoded patch:

>-  DWORD minchars = vmin_ ?: ulen;
>+  size_t minchars = vmin_ ?vmin_: ulen;

I could see changing this to size_t but not adding the extra vmin_.

>@@ -423,20 +426,21 @@ fhandler_serial::ioctl (unsigned int cmd
>                                               0, &mcr, 4, &cb, 0);
>                if (!result)
>                  {
>-                   __seterrno ();
>-                   res = -1;
>-                   goto out;
>+                   modem_status |= rts | dtr;

This is saying that if a function (DeviceIoControl) fails we fallback to
Win95 behavior.  Why wouldn't we want to reflect the failure of the
function?  Otherwise we could be masking an actual failure.

Anyway, I've checked in a variation of this change minus the
DeviceIoControl part.

cgf


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