summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--http.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/http.c b/http.c
index 98f9707625..14d535747d 100644
--- a/http.c
+++ b/http.c
@@ -1187,7 +1187,11 @@ struct http_object_request *new_http_object_request(const char *base_url,
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;
+ }
}
}