mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 17:58:30 +00:00
Fix flakes in runitd and popen_test
This commit is contained in:
parent
801224df67
commit
2ebc5781a1
18 changed files with 123 additions and 34 deletions
|
@ -34,17 +34,27 @@
|
|||
#include "libc/thread/tls.h"
|
||||
|
||||
textwindows int _check_interrupts(bool restartable, struct Fd *fd) {
|
||||
int rc;
|
||||
int e, rc;
|
||||
e = errno;
|
||||
if (_weaken(pthread_testcancel_np) &&
|
||||
(rc = _weaken(pthread_testcancel_np)())) {
|
||||
errno = rc;
|
||||
return -1;
|
||||
}
|
||||
if (_weaken(_check_sigalrm)) _weaken(_check_sigalrm)();
|
||||
if (!__tls_enabled || !(__get_tls()->tib_flags & TIB_FLAG_TIME_CRITICAL)) {
|
||||
if (_weaken(_check_sigchld)) _weaken(_check_sigchld)();
|
||||
if (fd && _weaken(_check_sigwinch)) _weaken(_check_sigwinch)(fd);
|
||||
if (_weaken(_check_sigalrm)) {
|
||||
_weaken(_check_sigalrm)();
|
||||
}
|
||||
if (_weaken(__sig_check) && _weaken(__sig_check)(restartable)) return eintr();
|
||||
if (!__tls_enabled || !(__get_tls()->tib_flags & TIB_FLAG_TIME_CRITICAL)) {
|
||||
if (_weaken(_check_sigchld)) {
|
||||
_weaken(_check_sigchld)();
|
||||
}
|
||||
if (fd && _weaken(_check_sigwinch)) {
|
||||
_weaken(_check_sigwinch)(fd);
|
||||
}
|
||||
}
|
||||
if (_weaken(__sig_check) && _weaken(__sig_check)(restartable)) {
|
||||
return eintr();
|
||||
}
|
||||
errno = e;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue