Fix flakes in runitd and popen_test

This commit is contained in:
Justine Tunney 2023-07-30 04:26:34 -07:00
parent 801224df67
commit 2ebc5781a1
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
18 changed files with 123 additions and 34 deletions

View file

@ -116,8 +116,9 @@ void OnInterrupt(int sig) {
}
void OnChildTerminated(int sig) {
int ws, pid;
int e, ws, pid;
sigset_t ss, oldss;
e = errno; // SIGCHLD can be called asynchronously
sigfillset(&ss);
sigdelset(&ss, SIGTERM);
sigprocmask(SIG_BLOCK, &ss, &oldss);
@ -140,6 +141,7 @@ void OnChildTerminated(int sig) {
}
}
sigprocmask(SIG_SETMASK, &oldss, 0);
errno = e;
}
wontreturn void ShowUsage(FILE *f, int rc) {