print errno when reporting a system call error
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
382fb07f7b
commit
5118d7f4e6
@ -164,9 +164,9 @@ int read_mmfile(mmfile_t *ptr, const char *filename)
|
||||
size_t sz;
|
||||
|
||||
if (stat(filename, &st))
|
||||
return error("Could not stat %s", filename);
|
||||
return error_errno("Could not stat %s", filename);
|
||||
if ((f = fopen(filename, "rb")) == NULL)
|
||||
return error("Could not open %s", filename);
|
||||
return error_errno("Could not open %s", filename);
|
||||
sz = xsize_t(st.st_size);
|
||||
ptr->ptr = xmalloc(sz ? sz : 1);
|
||||
if (sz && fread(ptr->ptr, sz, 1, f) != 1) {
|
||||
|
Reference in New Issue
Block a user