mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +00:00
runtime: use SA_RESTART when registering a signal
This really is the only sane way to register a signal. If this flag is not set, many syscalls will return EINTR (and not complete their operation) which will be a massive source of hard-to-debug bugs.
This commit is contained in:
committed by
Ron Evans
parent
6601c1b1a6
commit
95671469c7
@@ -15,6 +15,7 @@ void tinygo_signal_handler(int sig);
|
||||
void tinygo_signal_enable(uint32_t sig) {
|
||||
struct sigaction act = { 0 };
|
||||
act.sa_handler = &tinygo_signal_handler;
|
||||
act.sa_flags = SA_RESTART;
|
||||
sigaction(sig, &act, NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user