Skip to content

Commit

Permalink
sigwait: ignore errno except on Darwin (#34020)
Browse files Browse the repository at this point in the history
I am observing this value get set to EINTR sometimes on Linux. It is not
generally supposed to do that (though not prohibited either). That is
causing us to sometimes drop signals (usually SIGINT). Since we just
need this code for Darwin (ref #17626, #22041, #20174), we can remove
this from everywhere else.
  • Loading branch information
vtjnash authored and KristofferC committed Apr 11, 2020
1 parent 6c6c019 commit 54fd7f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/signals-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ static void *signal_listener(void *arg)
if (sigwait(&sset, &sig)) {
sig = SIGABRT; // this branch can't occur, unless we had stack memory corruption of sset
}
#ifdef _OS_DARWIN_
else if (!sig || errno == EINTR) {
// This should never happen, but it has been observed to occur
// when this thread gets used to handle run a signal handler (without SA_RESTART).
Expand All @@ -612,6 +613,7 @@ static void *signal_listener(void *arg)
// So signals really do seem to always just be lose-lose.
continue;
}
#endif
#ifndef HAVE_MACH
# ifdef HAVE_ITIMER
profile = (sig == SIGPROF);
Expand Down

0 comments on commit 54fd7f6

Please sign in to comment.