summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-05-08 09:47:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-05-09 19:29:08 (GMT)
commitd2e255eefab204fa6585963d5670b6cffdee866e (patch)
tree2becd23d5901861363f87aae7686cca013fc258e
parent7645d8f119997320c33423d95670824f05657bbb (diff)
downloadgit-d2e255eefab204fa6585963d5670b6cffdee866e.zip
git-d2e255eefab204fa6585963d5670b6cffdee866e.tar.gz
git-d2e255eefab204fa6585963d5670b6cffdee866e.tar.bz2
http.c: use error_errno() and warning_errno()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--http.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/http.c b/http.c
index 69da445..fa39b87 100644
--- a/http.c
+++ b/http.c
@@ -446,8 +446,7 @@ static int sockopt_callback(void *client, curl_socket_t fd, curlsocktype type)
rc = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&ka, len);
if (rc < 0)
- warning("unable to set SO_KEEPALIVE on socket %s",
- strerror(errno));
+ warning_errno("unable to set SO_KEEPALIVE on socket");
return 0; /* CURL_SOCKOPT_OK only exists since curl 7.21.5 */
}
@@ -1891,8 +1890,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
}
if (freq->localfile < 0) {
- error("Couldn't create temporary file %s: %s",
- freq->tmpfile, strerror(errno));
+ error_errno("Couldn't create temporary file %s", freq->tmpfile);
goto abort;
}
@@ -1937,8 +1935,8 @@ struct http_object_request *new_http_object_request(const char *base_url,
prev_posn = 0;
lseek(freq->localfile, 0, SEEK_SET);
if (ftruncate(freq->localfile, 0) < 0) {
- error("Couldn't truncate temporary file %s: %s",
- freq->tmpfile, strerror(errno));
+ error_errno("Couldn't truncate temporary file %s",
+ freq->tmpfile);
goto abort;
}
}