-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return value of fcntl not checked #88
Comments
I ran into this using the Celestron Firmware Manager, which uses this library. Here's the full stack trace:
It's hard to tell what the issue is as the raise on F_SETFL could have actually been triggered by the fcntl 2 lines above. |
Hi, thanks for the feedback. On cursory look I do not see that F_GETFL can fail and if it fails how can we check that it failed. |
It can fail with EBADF in case of bad file descriptor (http://www.gnu.org/software/libc/manual/html_node/Getting-File-Status-Flags.html). In that case it will return -1 and errno will be set. |
Ok, the man page then leaves something to desire for ;) ... ok I will fix this, thanks for spotting and contributing. |
Ok, this has been addressed will be released in 1.0.1 |
At
purejavacomm/src/purejavacomm/PureJavaSerialPort.java
Line 1091 in 5301918
Since this call can fail we might pass an invalid value for
flags
just after:This in turn can lead to an exception being raised, but at the wrong point, suggesting that what failed was the flag set, not the flag get!
The text was updated successfully, but these errors were encountered: