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

setBlocking logic garbles the fileno flags #44

Open
headius opened this issue Jul 17, 2024 · 0 comments
Open

setBlocking logic garbles the fileno flags #44

headius opened this issue Jul 17, 2024 · 0 comments
Milestone

Comments

@headius
Copy link
Member

headius commented Jul 17, 2024

While investigating why nonblocking does not seem to work exactly right for unix sockets, I found that the flags seem to be getting garbled by the existing setBlocking logic.

For logic that sets it to nonblock, the flags start as 2, then with O_NONBLOCK they become 6 and are set back into fcntl. By the time it tries to set it blocking again, the flags are nonsense. Once I saw 194, and another time 491294 or something like that.

By contrast a version using the fcntl bound by jnr-posix seems to properly set it to 6 and back to 2.

@headius headius transferred this issue from jnr/jnr-unixsocket Jul 17, 2024
headius added a commit to headius/jnr-enxio that referenced this issue Jul 17, 2024
After matching jnr-posix, this fixes issues setting blocking mode
reported in jnr#44.

Exercise for the future would be to only have one definition of
these methods in the jnr tree.
headius added a commit to headius/jnr-enxio that referenced this issue Jul 17, 2024
@headius headius added this to the 0.32.18 milestone Jul 17, 2024
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

No branches or pull requests

1 participant