Skip to content

Commit e8bd78c

Browse files
torvaldsgitster
authored andcommitted
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 <[email protected]>
1 parent 720fe22 commit e8bd78c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sha1_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2241,7 +2241,7 @@ static void close_sha1_file(int fd)
22412241
fsync_or_die(fd, "sha1 file");
22422242
fchmod(fd, 0444);
22432243
if (close(fd) != 0)
2244-
die("unable to write sha1 file");
2244+
die("error when closing sha1 file (%s)", strerror(errno));
22452245
}
22462246

22472247
/* Size of directory component, including the ending '/' */

0 commit comments

Comments
 (0)