From: Stefan Eissing Date: Tue, 15 Apr 2025 12:01:19 +0000 (+0200) Subject: tool_cb_write.c: handle EINTR on flush X-Git-Tag: curl-8_14_0~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5be8e2c3f9cdbf0725d7b25ab3255249253e9e8;p=thirdparty%2Fcurl.git tool_cb_write.c: handle EINTR on flush Report-and-patch-by: Nils Goroll Fixes #17061 Closes #17063 --- diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c index 7a575c98f6..1cd0524df6 100644 --- a/src/tool_cb_wrt.c +++ b/src/tool_cb_wrt.c @@ -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; }