Chris,
  Per your comments on my prior patches, I have re-architected my error-checking changes so that the short-circuiting behavior in tcsetattr() is gone.  I also cleaned up the B0 (ie. drop DTR) support to more closely resemble what POSIX expects while not enraging Win32 :)  Please let me know if this passes muster - the prior test case program still applies.  My only remaining question is why errno isn't being propagated back up to the application?  Thanks,

-Troy

2003-01-22  Troy Curtiss  <[EMAIL PROTECTED]>

        * fhandler_serial.cc (fhandler_serial::tcsetattr): Add error-checking
        so that if any Win32 SetComm*() calls fail, errno gets set to EINVAL
     and tcsetattr() returns -1. Catches invalid bitrates, mostly.
        * fhandler_serial.cc (fhandler_serial::tcsetattr): If baud rate setting
     is B0, just drop DTR and leave Win32 DCB bitrate as-is since 0 is not
     a valid Win32 setting.
        (fhandler_serial::tcgetattr): If DTR is low, populate the bitrate as B0,
     otherwise get it from the DCB.  Works around Win32's lack of bitrate 0
     at the expense of using DTR as the flag (POSIX behavior.)

Attachment: serial_support_patch
Description: Binary data

Reply via email to