Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Exit correctly on write errors #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jneen
Copy link

@jneen jneen commented Apr 26, 2021

This line (from a 9-year-old commit!) causes alsa_in to infinite-loop when a device is unplugged, writing err = -11 to the standard output. It's possible -11 could be special-cased if it represents a more specific kind of error, but the program should exit gracefully with an error code in this case.

This line (from a 9-year-old commit!) causes `alsa_in` to infinite-loop when a device is unplugged, writing `err = -11` to the standard output. It's possible `-11` could be special-cased if it represents a more specific kind of error, but the program should exit gracefully with an error code in this case.
@falkTX
Copy link
Member

falkTX commented Apr 26, 2021

While appreciated, quitting on every error is not wanted.
Error 11 is EAGAIN "Try again", so seems bad to just close it. It is very likely that this part of the code put as comment on purpose.
So best would be to give it a threshold.
If we get EAGAIN 5 times in a row, close the tool.

@dvzrv
Copy link

dvzrv commented Jan 2, 2022

@jneen thanks for your contribution!

Can you please re-do your PR against the https://github.com/jackaudio/jack-example-tools repository?
I tried to cherry-pick your commits from this repository (after a git-filter-repo), but due to the large amounts of changes in the new repository (which is a combination of this repository and the changes applied via the jack2 repository) it is non-trivial to do.

As your changes are very small/trivial it would be easier to redo the pull request. Many thanks! :)

@jneen
Copy link
Author

jneen commented Jan 3, 2022

I no longer use linux or jack so I have no way to test. It seems fairly small though so I'm sure yall can handle it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants