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

socket_can_read doesn't work when the socket's fd is 0 #125

Closed
nramon opened this issue Feb 16, 2018 · 0 comments
Closed

socket_can_read doesn't work when the socket's fd is 0 #125

nramon opened this issue Feb 16, 2018 · 0 comments

Comments

@nramon
Copy link
Contributor

nramon commented Feb 16, 2018

First of all, thanks for fping. It's a great piece of software!

Yesterday I saw it fail when called from a script. The problem was that socket_can_read doesn't work when the socket's file descriptor is 0, because it uses this value to signal a timeout.

This behaviour can be reproduced fairly easily:

# bash -c 'exec 0<&-; src/fping 127.0.0.1'
127.0.0.1 is unreachable

I've submitted a pull request (#124) that fixes the problem:

# bash -c 'exec 0<&-; src/fping 127.0.0.1'
127.0.0.1 is alive

Best regards.

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

2 participants