Skip to content

Fix kissattach 'Device or resource busy' #24

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

Merged
merged 2 commits into from
Mar 26, 2016
Merged

Fix kissattach 'Device or resource busy' #24

merged 2 commits into from
Mar 26, 2016

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 martinhpedersen changed the title Fix/kissattach issue Fix kissattach 'Device or resource busy' Mar 17, 2016
@DwaineGarden
Copy link
Contributor

Is this going to get pulled?

@wb2osz wb2osz merged commit 5920ecd into wb2osz:dev Mar 26, 2016
@wb2osz
Copy link
Owner

wb2osz commented Mar 26, 2016

Thanks for the fix!

This is now in the "dev" branch which is the latest development (sometimes unstable) location. To get this version:

git pull; git checkout dev; make clean; make

It was tested on Ubuntu. If a few people could test it on other Linux variants, and all goes well, I will cherry pick it to the "master" branch which is now version 1.3 beta test.

@martinhpedersen
Copy link
Contributor Author

Glad I could make a small contribution to this great project!

That missing FD_SET call was embarrasing though, hehe! I should have at least caught it while testing the patch, but I mixed up read/write and ended up testing the master_fd writes instead of the modified read/select.

Anyway, I have tested current dev (ccae752) on my RPi 2 running Raspbian Jessie. I've made several connects (wl2k/FBB) using Linux AX 25 without any problems. Kissattach seems happy with the fix on Raspbian :)

73 de LA5NTA

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.

3 participants