Skip to content

Commit 1ad5e49

Browse files
authored
sigwait: ignore errno except on Darwin (#34020)
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.
1 parent 1baeb21 commit 1ad5e49

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/signals-unix.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ static void *signal_listener(void *arg)
600600
if (sigwait(&sset, &sig)) {
601601
sig = SIGABRT; // this branch can't occur, unless we had stack memory corruption of sset
602602
}
603+
#ifdef _OS_DARWIN_
603604
else if (!sig || errno == EINTR) {
604605
// This should never happen, but it has been observed to occur
605606
// when this thread gets used to handle run a signal handler (without SA_RESTART).
@@ -612,6 +613,7 @@ static void *signal_listener(void *arg)
612613
// So signals really do seem to always just be lose-lose.
613614
continue;
614615
}
616+
#endif
615617
#ifndef HAVE_MACH
616618
# ifdef HAVE_ITIMER
617619
profile = (sig == SIGPROF);

0 commit comments

Comments
 (0)