Skip to content
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

Check return value of ioctl TIOCGSERIAL on Linux #174

Merged
merged 1 commit into from
Dec 7, 2018

Conversation

Arth-ur
Copy link
Contributor

@Arth-ur Arth-ur commented Dec 7, 2018

In the fix for issue #153, the return value of the ioctl TIOCGSERIAL should be check to ensure that the serInfo variable has correctly been set before using it for TIOCSSERIAL.
Since Linux kernel 3.19, the TIOCSSERIAL ioctl prints a warning message when called (tty_warn_deprecated_flags). This behaviour will change in the next kernel version (4.20) but in the mean time this warning is spammed to the users.

In this PR, I check the return value of the TIOCGSERIAL ioctl which generates no warning. A return value not equal to 0 means that TIOCGSERIAL is not handled and TIOCSSERIAL is either not handled or generates a warning. When the return value is not 0, I skip the TIOCSSERIAL ioctl to avoid the warning.

@hedgecrw hedgecrw merged commit c5741a2 into Fazecast:master Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants