summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb99190)
raw | patch | inline | side by side (parent: bb99190)
author | Jeff Lasslett <jeff.lasslett@gmail.com> | |
Mon, 10 Aug 2009 16:05:06 +0000 (00:05 +0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 10 Aug 2009 20:26:18 +0000 (13:26 -0700) |
In new_http_object_request(), check ftruncate() call return value and
handle possible errors.
Signed-off-by: Jeff Lasslett <jeff.lasslett@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
handle possible errors.
Signed-off-by: Jeff Lasslett <jeff.lasslett@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c | patch | blob | history |
index 98f9707625dd1e28dc3206f76ab27b231c1425a9..14d535747d943c2db3d45d82439f3ee9633ed2d9 100644 (file)
--- a/http.c
+++ b/http.c
if (prev_posn>0) {
prev_posn = 0;
lseek(freq->localfile, 0, SEEK_SET);
- ftruncate(freq->localfile, 0);
+ if (ftruncate(freq->localfile, 0) < 0) {
+ error("Couldn't truncate temporary file %s for %s: %s",
+ freq->tmpfile, freq->filename, strerror(errno));
+ goto abort;
+ }
}
}