socketpair: clear 'err' when retrying due to EINTR

If the first write was interrupted by a signal and a subsequent write
succeeds, the function would still erroneously return EINTR.

Found by Codex Security
Closes #20809
This commit is contained in:
Daniel Stenberg 2026-03-03 23:50:08 +01:00
parent e49efce12f
commit e47b6e657a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -317,6 +317,7 @@ int Curl_wakeup_signal(curl_socket_t socks[2])
#endif
while(1) {
err = 0;
if(wakeup_write(socks[1], buf, sizeof(buf)) < 0) {
err = SOCKERRNO;
#ifdef USE_WINSOCK