summaryrefslogtreecommitdiff
path: root/ident.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-17 21:38:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-05-17 21:38:28 (GMT)
commit40cfc95856594ddd04ae6ef3bfd041346c4854ec (patch)
tree13f4a476ed02d287c34a3460341deacb2dcd6a53 /ident.c
parent8648eacc1d45a7d25cb4d293549bbe6ae17cbd81 (diff)
parent1da045fb9db5db8f01eb5e7c6106880ca5274643 (diff)
downloadgit-40cfc95856594ddd04ae6ef3bfd041346c4854ec.zip
git-40cfc95856594ddd04ae6ef3bfd041346c4854ec.tar.gz
git-40cfc95856594ddd04ae6ef3bfd041346c4854ec.tar.bz2
Merge branch 'nd/error-errno'
The code for warning_errno/die_errno has been refactored and a new error_errno() reporting helper is introduced. * nd/error-errno: (41 commits) wrapper.c: use warning_errno() vcs-svn: use error_errno() upload-pack.c: use error_errno() unpack-trees.c: use error_errno() transport-helper.c: use error_errno() sha1_file.c: use {error,die,warning}_errno() server-info.c: use error_errno() sequencer.c: use error_errno() run-command.c: use error_errno() rerere.c: use error_errno() and warning_errno() reachable.c: use error_errno() mailmap.c: use error_errno() ident.c: use warning_errno() http.c: use error_errno() and warning_errno() grep.c: use error_errno() gpg-interface.c: use error_errno() fast-import.c: use error_errno() entry.c: use error_errno() editor.c: use error_errno() diff-no-index.c: use error_errno() ...
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 4fd82d1..139c528 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;