summaryrefslogtreecommitdiffstats
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-03-27 21:55:44 +0200
committerJunio C Hamano <junkio@cox.net>2007-03-27 21:56:01 +0200
commite82973cfb046b4298114368e6d194a3418f2a30c (patch)
tree743354fa542cd06fde86587844b67a5641fe8dd7 /sha1_file.c
parentgit.el: Display some information about the HEAD commit. (diff)
downloadgit-e82973cfb046b4298114368e6d194a3418f2a30c.tar.xz
git-e82973cfb046b4298114368e6d194a3418f2a30c.zip
sha1_file.c (write_sha1_file): Detect close failure
This is in the same spirit as earlier fix to write_sha1_from_fd(). Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 42aef331f2..9c26038420 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2020,7 +2020,8 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
if (write_buffer(fd, compressed, size) < 0)
die("unable to write sha1 file");
fchmod(fd, 0444);
- close(fd);
+ if (close(fd))
+ die("unable to write sha1 file");
free(compressed);
return move_temp_to_file(tmpfile, filename);