Skip to content

Commit d2e255e

Browse files
pcloudsgitster
authored andcommitted
http.c: use error_errno() and warning_errno()
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7645d8f commit d2e255e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

http.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,7 @@ static int sockopt_callback(void *client, curl_socket_t fd, curlsocktype type)
446446

447447
rc = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&ka, len);
448448
if (rc < 0)
449-
warning("unable to set SO_KEEPALIVE on socket %s",
450-
strerror(errno));
449+
warning_errno("unable to set SO_KEEPALIVE on socket");
451450

452451
return 0; /* CURL_SOCKOPT_OK only exists since curl 7.21.5 */
453452
}
@@ -1891,8 +1890,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
18911890
}
18921891

18931892
if (freq->localfile < 0) {
1894-
error("Couldn't create temporary file %s: %s",
1895-
freq->tmpfile, strerror(errno));
1893+
error_errno("Couldn't create temporary file %s", freq->tmpfile);
18961894
goto abort;
18971895
}
18981896

@@ -1937,8 +1935,8 @@ struct http_object_request *new_http_object_request(const char *base_url,
19371935
prev_posn = 0;
19381936
lseek(freq->localfile, 0, SEEK_SET);
19391937
if (ftruncate(freq->localfile, 0) < 0) {
1940-
error("Couldn't truncate temporary file %s: %s",
1941-
freq->tmpfile, strerror(errno));
1938+
error_errno("Couldn't truncate temporary file %s",
1939+
freq->tmpfile);
19421940
goto abort;
19431941
}
19441942
}

0 commit comments

Comments
 (0)