summaryrefslogtreecommitdiff
path: root/ident.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-05-08 16:47:49 +0700
committerJunio C Hamano <gitster@pobox.com>2016-05-09 12:29:08 -0700
commita26f4ed682a64dcc6092c28dadb3f5c139d50576 (patch)
tree3e4f29490ca7215991c6f8f93e67e7a95e0afc61 /ident.c
parentd2e255eefab204fa6585963d5670b6cffdee866e (diff)
downloadgit-a26f4ed682a64dcc6092c28dadb3f5c139d50576.tar.gz
ident.c: use warning_errno()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ident.c')
-rw-r--r--ident.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ident.c b/ident.c
index 6e125821f0..337a4210a5 100644
--- a/ident.c
+++ b/ident.c
@@ -75,14 +75,12 @@ static int add_mailname_host(struct strbuf *buf)
mailname = fopen("/etc/mailname", "r");
if (!mailname) {
if (errno != ENOENT)
- warning("cannot open /etc/mailname: %s",
- strerror(errno));
+ warning_errno("cannot open /etc/mailname");
return -1;
}
if (strbuf_getline(&mailnamebuf, mailname) == EOF) {
if (ferror(mailname))
- warning("cannot read /etc/mailname: %s",
- strerror(errno));
+ warning_errno("cannot read /etc/mailname");
strbuf_release(&mailnamebuf);
fclose(mailname);
return -1;
@@ -125,7 +123,7 @@ static void add_domainname(struct strbuf *out, int *is_bogus)
char buf[1024];
if (gethostname(buf, sizeof(buf))) {
- warning("cannot get host name: %s", strerror(errno));
+ warning_errno("cannot get host name");
strbuf_addstr(out, "(none)");
*is_bogus = 1;
return;