Skip to content

siginfo_init should maybe set SA_RESTART flag on sigaction (EINTR) #336

@cemeyer

Description

@cemeyer

sigaction() in siginfo_init() sets sa_flags = 0. The SA_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:

tarsnap: Can't read -: Interrupted system call

(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 of clearerror(3) if errno == EINTR, I guess.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions