diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2016-05-08 16:47:47 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-05-09 12:29:08 -0700 |
commit | 7645d8f119997320c33423d95670824f05657bbb (patch) | |
tree | 6290d7764e021537b8c7322cba828e183bdd6204 /grep.c | |
parent | ddf362a2a9b6cf784497162d21556a950f99dce8 (diff) | |
download | git-7645d8f119997320c33423d95670824f05657bbb.tar.gz |
grep.c: use error_errno()
While at there, improve the error message a bit (what operation failed?)
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 'grep.c')
-rw-r--r-- | grep.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1732,7 +1732,7 @@ static int grep_source_load_file(struct grep_source *gs) if (lstat(filename, &st) < 0) { err_ret: if (errno != ENOENT) - error(_("'%s': %s"), filename, strerror(errno)); + error_errno(_("failed to stat '%s'"), filename); return -1; } if (!S_ISREG(st.st_mode)) @@ -1743,7 +1743,7 @@ static int grep_source_load_file(struct grep_source *gs) goto err_ret; data = xmallocz(size); if (st.st_size != read_in_full(i, data, size)) { - error(_("'%s': short read %s"), filename, strerror(errno)); + error_errno(_("'%s': short read"), filename); close(i); free(data); return -1; |