aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-03-27 12:55:44 -0700
committerJunio C Hamano <junkio@cox.net>2007-03-27 12:56:01 -0700
commite82973cfb046b4298114368e6d194a3418f2a30c (patch)
tree743354fa542cd06fde86587844b67a5641fe8dd7 /sha1_file.c
parentb704e589f411d51c7240d104d88422aa2d757822 (diff)
downloadgit-e82973cfb046b4298114368e6d194a3418f2a30c.tar.gz
git-e82973cfb046b4298114368e6d194a3418f2a30c.tar.xz
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 42aef331f..9c2603842 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);