summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4d9516)
raw | patch | inline | side by side (parent: e4d9516)
author | Jim Meyering <jim@meyering.net> | |
Mon, 26 Mar 2007 13:57:23 +0000 (15:57 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 27 Mar 2007 19:43:49 +0000 (12:43 -0700) |
I stumbled across this in the context of the fchmod 0444 patch.
At first, I was going to unlink and call error like the two subsequent
tests do, but a failed write (above) provokes a "die", so I made
this do the same. This is testing for a write failure, after all.
Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
At first, I was going to unlink and call error like the two subsequent
tests do, but a failed write (above) provokes a "die", so I made
this do the same. This is testing for a write failure, after all.
Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_file.c | patch | blob | history |
diff --git a/sha1_file.c b/sha1_file.c
index 0897b945e5dace8189adc35e6eea389cfc7606af..42aef331f2e028d625dd2f6354cda2dfd55e71e0 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
inflateEnd(&stream);
fchmod(local, 0444);
- close(local);
+ if (close(local) != 0)
+ die("unable to write sha1 file");
SHA1_Final(real_sha1, &c);
if (ret != Z_STREAM_END) {
unlink(tmpfile);