tool_cb_write.c: handle EINTR on flush

Report-and-patch-by: Nils Goroll
Fixes #17061
Closes #17063
This commit is contained in:
Stefan Eissing 2025-04-15 14:01:19 +02:00 committed by Daniel Stenberg
parent 01c429c4a8
commit a5be8e2c3f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -364,7 +364,12 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
if(config->nobuffer) {
/* output buffering disabled */
int res = fflush(outs->stream);
int res;
do {
res = fflush(outs->stream);
/* Keep retrying in the hope that it is not interrupted sometime */
/* !checksrc! disable ERRNOVAR 1 */
} while(res && errno == EINTR);
if(res)
return CURL_WRITEFUNC_ERROR;
}