-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor signal handler to use self-pipe trick. Removes signal race c…
…ondition and still works if SA_RESTART is set.
- Loading branch information
Showing
1 changed file
with
81 additions
and
12 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
9a6e91d
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.
The for loop used for setting the pipe fd's non-blocking has a bug: the loop variable (i) is not used at all, the loop sets pipefds[0] twice.
Wouldn't it be reasonable to use pipe2() to set non-block instead of the fcntl()'s?