-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle polls with both POLLIN and POLLHUP (#9)
The behaviour of poll() seems to differ between Linux and Darwin when the child process has closed the pipe and poll() returns both POLLIN and POLLHUP set on the returned events value. On Linux this is a sign that we can read from the pipe one more time, but on Darwin it seems that POLLIN remains set after the final read so we need to add extra logic to make sure to stop polling for POLLIN after a failed read in the presence of POLLHUP. Also fix minor formatting issues introduced by Devin.
- Loading branch information
1 parent
7d5f5c5
commit 813ed22
Showing
1 changed file
with
25 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters