diff options
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/read-cache.c b/read-cache.c index 3f587110cb..4e3e272ee4 100644 --- a/read-cache.c +++ b/read-cache.c @@ -638,7 +638,7 @@ int add_file_to_index(struct index_state *istate, const char *path, int flags) { struct stat st; if (lstat(path, &st)) - die("%s: unable to stat (%s)", path, strerror(errno)); + die_errno("unable to stat '%s'", path); return add_to_index(istate, path, &st, flags); } @@ -1251,11 +1251,11 @@ int read_index_from(struct index_state *istate, const char *path) if (fd < 0) { if (errno == ENOENT) return 0; - die("index file open failed (%s)", strerror(errno)); + die_errno("index file open failed"); } if (fstat(fd, &st)) - die("cannot stat the open index (%s)", strerror(errno)); + die_errno("cannot stat the open index"); errno = EINVAL; mmap_size = xsize_t(st.st_size); @@ -1265,7 +1265,7 @@ int read_index_from(struct index_state *istate, const char *path) mmap = xmmap(NULL, mmap_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); close(fd); if (mmap == MAP_FAILED) - die("unable to map index file"); + die_errno("unable to map index file"); hdr = mmap; if (verify_hdr(hdr, mmap_size) < 0) |