Retry open_cloexec for signals other than SIGINT - #10251
Merged
Merged
Conversation
mqudsi
approved these changes
Jan 25, 2024
mqudsi
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Lots of places in our code that can be improved to be more resilient to EINTR.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This retries {w,}open_cloexec if it gets EINTR, unless it got a cancel signal (i.e. SIGINT).
That means if you do
cat >fifo(where "fifo" is a fifo without a reader), you can only stop it if you ctrl-c, not if you e.g. resize the terminal.It also no longer prints the warning when you press ctrl-c - SIGINT is expected, we don't print anything in a lot of cases.
This affects all uses of open_cloexec, e.g. in
cd. Most probably won't see a difference, the man page for open(2) on my system claims:Fixes #10250
TODOs: