nyholku/purejavacomm — pull request #28 by cleitner (2013-05-18 17:23:37+00:00)
Title: tcsetattr effect is not checked/Handling of termios flags

The termios man page explains, that `tcsetattr` succeeds if any changes have been applied, not necessarily all of them.

And some drivers do override `termios` flags if certain features are not supported (`CMSPAR` and the `ti_3140` driver for example), though it's no guarantee that the driver won't silently accept invalid configurations (`ftdi_sio` and `CS6`).

I have a patch for 1.5 stop bit and mark/space parity support which benefit from this patch :innocent:.

However there's a drawback if this would indeed be implemented. Existing users might have never noticed that certain settings didn't work and chances are high that some applications will break.

I would also like to address a strange pattern often seen together with termios: Flags are only masked out or ORed into an existing flag bitfield (e.g. `c_flags`) obtained after opening the port. I would suggest to force all `Termios` flags to 0 or another sane default, because unknown flags can easily influence PJCs operation in a negative way.