mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 17:28:30 +00:00
Avoid linking win32 signals impl
This shaves ~4kb off o/tiny/examples/hello2.com by avoiding linking the WIN32 signals polyfill unless sigaction() is being used. See #965
This commit is contained in:
parent
2b960bb249
commit
70155df7a9
8 changed files with 37 additions and 31 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "libc/calls/struct/sigset.internal.h"
|
||||
#include "libc/intrin/dll.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/nt/enum/wait.h"
|
||||
#include "libc/nt/events.h"
|
||||
#include "libc/nt/runtime.h"
|
||||
|
@ -76,8 +77,8 @@ static textwindows int __proc_wait(int pid, int *wstatus, int options,
|
|||
if (_check_cancel() == -1) {
|
||||
return -1;
|
||||
}
|
||||
if ((sig = __sig_get(waitmask))) {
|
||||
handler_was_called = __sig_relay(sig, SI_KERNEL, waitmask);
|
||||
if (_weaken(__sig_get) && (sig = _weaken(__sig_get)(waitmask))) {
|
||||
handler_was_called = _weaken(__sig_relay)(sig, SI_KERNEL, waitmask);
|
||||
if (_check_cancel() == -1) {
|
||||
return -1; // ECANCELED because SIGTHR was just handled
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue