tarm / serial

BSD 3-Clause "New" or "Revised" License
1.6k stars 451 forks source link

OpenPort does not return an error when no baud rate is specified on Linux #85

Open AdamSLevy opened 5 years ago

AdamSLevy commented 5 years ago

When attempting to open a port without specifying a baud rate an error should be returned. On Linux a nil error and nil port is returned.

On line 49 in serial_linux.go you can see that the return occurs before any error is set.

It is also possible that this error is also occurring in the Windows implementation but I can't test that. On line 211 in serial_windows.go a syscall is made but the baud rate is never checked up to this point.