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>maint
parent
b704e589f4
commit
e82973cfb0
|
@ -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)
|
if (write_buffer(fd, compressed, size) < 0)
|
||||||
die("unable to write sha1 file");
|
die("unable to write sha1 file");
|
||||||
fchmod(fd, 0444);
|
fchmod(fd, 0444);
|
||||||
close(fd);
|
if (close(fd))
|
||||||
|
die("unable to write sha1 file");
|
||||||
free(compressed);
|
free(compressed);
|
||||||
|
|
||||||
return move_temp_to_file(tmpfile, filename);
|
return move_temp_to_file(tmpfile, filename);
|
||||||
|
|
Loading…
Reference in New Issue