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
monitor-fds: Fix on macOS. #1872
Conversation
Testing this on my box now, but based on the simplified tests I fully expect it to work. |
src/libutil/monitor-fd.hh
Outdated
fds[0].events = 0; | ||
/* This shouldn't be necessary, but macOS doesn't seem to | ||
like a zeroed out events field. | ||
See https://openradar.appspot.com/radar?id=5047895313088512 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely, thanks!
Ugh, hitting the assertion on the next line, digging in... |
poll is timing out even with a |
Seems related... curl/curl#1057 |
953cd66
to
9fd78c0
Compare
OK, this is tested and working. Ugly, but so is the problem domain. |
src/libutil/monitor-fd.hh
Outdated
fds[0].events = POLLHUP; | ||
auto count = poll(fds, 1, -1); | ||
if (count == -1) abort(); // can't happen | ||
if (count == 0) continue; // shouldn't happen, but macOS is terrbile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to insert a delay here if this turns out to cause lots of spinning.
9fd78c0
to
ac973a6
Compare
Fixes #1871.