unix: fix non-synchronized access in signal.c
Check the return value of uv__signal_lock(); don't mutate the signal watcher tree in the signal handler if we failed to acquire the lock.
This commit is contained in:
parent
38df93cfed
commit
1800efc138
@ -141,7 +141,10 @@ static void uv__signal_handler(int signum) {
|
||||
saved_errno = errno;
|
||||
memset(&msg, 0, sizeof msg);
|
||||
|
||||
uv__signal_lock();
|
||||
if (uv__signal_lock()) {
|
||||
errno = saved_errno;
|
||||
return;
|
||||
}
|
||||
|
||||
for (handle = uv__signal_first_handle(signum);
|
||||
handle != NULL && handle->signum == signum;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user