Skip to content

Commit

Permalink
close_sha1_file(): make it easier to diagnose errors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed Mar 24, 2009
1 parent 720fe22 commit e8bd78c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 '/' */
Expand Down

0 comments on commit e8bd78c

Please sign in to comment.