mirror of
https://github.com/curl/curl.git
synced 2026-08-24 22:13:33 +03:00
eliminate a race condition in Curl_resolv_timeout()
This commit is contained in:
parent
e7e37a246a
commit
64ac64e783
2 changed files with 6 additions and 2 deletions
|
|
@ -628,6 +628,9 @@ int Curl_resolv_timeout(struct connectdata *conn,
|
|||
clean_up:
|
||||
|
||||
if (timeout > 0) {
|
||||
if(!prev_alarm)
|
||||
/* deactivate a possibly active alarm before uninstalling the handler */
|
||||
alarm(0);
|
||||
|
||||
#ifdef HAVE_SIGACTION
|
||||
if(keep_copysig) {
|
||||
|
|
@ -664,8 +667,6 @@ clean_up:
|
|||
else
|
||||
alarm((unsigned int)alarm_set);
|
||||
}
|
||||
else
|
||||
alarm(0); /* just shut it off */
|
||||
}
|
||||
#endif /* USE_ALARM_TIMEOUT */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue