mirror of
https://github.com/curl/curl.git
synced 2026-08-25 00:03:33 +03:00
servers: drop re-registering the signal handler on modern systems
Before this patch modern systems used `sigaction()` and `SA_RESTART` to install signal handlers, but the signal handler function itself still made a call to the legacy `signal()` function to re-register itself before returning. Re-registering the handler is not necessary with `sigaction()`. It's also undesired to use the legacy API when the modern one is available. Fix by guarding off this call in builds that support the modern API. Follow-up to3fb6e5a010#6529 Follow-up to18cbb4d7d6Closes #22497
This commit is contained in:
parent
b11e0026f7
commit
133785b159
1 changed files with 2 additions and 0 deletions
|
|
@ -415,7 +415,9 @@ static void exit_signal_handler(int signum)
|
|||
(void)SetEvent(exit_event);
|
||||
#endif
|
||||
}
|
||||
#if !(defined(HAVE_SIGACTION) && defined(SA_RESTART))
|
||||
(void)signal(signum, exit_signal_handler);
|
||||
#endif
|
||||
errno = old_errno;
|
||||
}
|
||||
#if defined(CURL_HAVE_DIAG) && !defined(__clang__)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue