X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/0408d8c3b23367d09980cb27a5225a9f034d7610..3c8cda8b05d6eeaef76c7ccc673fe378b0c74f37:/methods/http.cc diff --git a/methods/http.cc b/methods/http.cc index d4e231fbe..b3c791fa0 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -368,8 +368,8 @@ bool ServerState::Close() /*}}}*/ // ServerState::RunHeaders - Get the headers before the data /*{{{*/ // --------------------------------------------------------------------- -/* Returns 0 if things are OK, 1 if an IO error occursed and 2 if a header - parse error occured */ +/* Returns 0 if things are OK, 1 if an IO error occurred and 2 if a header + parse error occurred */ int ServerState::RunHeaders() { State = Header; @@ -941,7 +941,8 @@ int HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv) if (Srv->StartPos >= 0) { Res.ResumePoint = Srv->StartPos; - ftruncate(File->Fd(),Srv->StartPos); + if (ftruncate(File->Fd(),Srv->StartPos) < 0) + _error->Errno("ftruncate", _("Failed to truncate file")); } // Set the start point