diff options
author | Junio C Hamano <junkio@cox.net> | 2007-03-27 12:55:44 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-27 12:56:01 -0700 |
commit | e82973cfb046b4298114368e6d194a3418f2a30c (patch) | |
tree | 743354fa542cd06fde86587844b67a5641fe8dd7 /sha1_file.c | |
parent | b704e589f411d51c7240d104d88422aa2d757822 (diff) | |
download | git-e82973cfb046b4298114368e6d194a3418f2a30c.tar.gz |
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.c | 3 |
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); |