aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-24 12:31:36 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-24 14:39:20 -0700
commite8bd78c3fcba35b8344ea6bab6218b793e507ea3 (patch)
treecb6d15c6878b0f78ba783bd231d354467530c0ac /sha1_file.c
parent720fe22d50a58e3308124ec7f5b0fa6c17be3d22 (diff)
downloadgit-e8bd78c3fcba35b8344ea6bab6218b793e507ea3.tar.gz
git-e8bd78c3fcba35b8344ea6bab6218b793e507ea3.tar.xz
close_sha1_file(): make it easier to diagnose errors
A bug report with "unable to write sha1 file" made us realize that we do not have enough information to guess why close() is failing. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index bea958ec8..bcfcab351 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2241,7 +2241,7 @@ static void close_sha1_file(int fd)
fsync_or_die(fd, "sha1 file");
fchmod(fd, 0444);
if (close(fd) != 0)
- die("unable to write sha1 file");
+ die("error when closing sha1 file (%s)", strerror(errno));
}
/* Size of directory component, including the ending '/' */