Fix confusing 'Cannot write to ... (Success)' message

* src/http.c (gethttp): Store/restore errno value.

Reported-by: Christian Rosentreter, Andries E. Brouwer
This commit is contained in:
Tim Rühsen 2023-10-22 14:00:57 +02:00
parent 8e8900613c
commit 25525f8037

View File

@ -4164,7 +4164,11 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs,
err = open_output_stream (hs, count, &fp);
if (err != RETROK)
{
/* Make sure that errno doesn't get clobbered.
* This is the case for OpenSSL's SSL_shutdown(). */
int tmp_errno = errno;
CLOSE_INVALIDATE (sock);
errno = tmp_errno;
retval = err;
goto cleanup;
}