-
Notifications
You must be signed in to change notification settings - Fork 60
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
siginfo_init should maybe set SA_RESTART flag on sigaction (EINTR) #336
Comments
What's your command line, what OS are you running on, and what are you doing to trigger a signal? It seems like |
|
Re: fread, it can be blamed on lib/libc/stdio/refill.c:
( Edit: In fact, it seems like very little of FreeBSD libc (and none of libc/stdio) handles EINTR in any explicit way. |
FWIW, POSIX 2017 specifically calls out |
sigaction()
insiginfo_init()
setssa_flags = 0
. TheSA_RESTART
flag has the nice property of resuming some typical system calls without returning-1 / errno=EINTR
to the application.Alternatively, tarsnap should handle EINTR gracefully. I see some checks for EINTR in the source code.
But it does not appear to be consistently handled gracefully:
(Given this is EINTR and not ENOMEM, I think the printed line can only come from one location in the source code: https://github.com/Tarsnap/tarsnap/blob/master/tar/util.c#L358-L360 . I'm not sure what the right interaction between EINTR and
FILE
streams is. You could take the minimal approach ofclearerror(3)
if errno == EINTR, I guess.)The text was updated successfully, but these errors were encountered: