Skip to content

Fix kissattach 'Device or resource busy' #23

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

Closed
wants to merge 1 commit into from
Closed

Fix kissattach 'Device or resource busy' #23

wants to merge 1 commit into from

Conversation

martinhpedersen
Copy link
Contributor

Hi,

I got bit by the kissattach issue mentioned in the user guide on Debian Jessie. I though it was strange, because I've written a program, fldigiattach, that exposes a pty slave to kissattach. I never experienced the issue.

After some debugging I realized that the only real difference between fldigiattach and the code in kiss.c was that fldigiattach, which is written in Go, indirectly uses non-blocking IO syscalls. This got me thinking that maybe the blocking read from pt_master_fd was causing the "Device or resource busy" error seen by kissattach.

This fix resolves the issue by using select() to wait for data before reading from the master fd.

I've confirmed the fix on Debian Jessie.

Sometimes kissattach had an issue using the pseudo terminal on some versions
of Linux: 'Error setting line discipline: TIOCSETD: Device or resource busy'.

This fix resolves the issue by not reading from the pty's master fd, until
kissattach has opened and configured the slave. This is implemented using
select() to wait for data before reading from the master fd.
@martinhpedersen
Copy link
Contributor Author

I just realized I deleted the kissattach error message in the same commit. This was not intentional. If you want, I'll split the commit in two and do a force push.

73 de LA5NTA

@martinhpedersen
Copy link
Contributor Author

Closing this and creating a new PR for the dev branch.

@martinhpedersen martinhpedersen deleted the fix/kissattach_issue branch March 17, 2016 08:46
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.

1 participant