Commit a8996b9e authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

use the return code from lseek() to detect problems and bail out if so

parent 94095c61
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -367,8 +367,11 @@ CURLcode Curl_file(struct connectdata *conn, bool *done)
  if(fstated)
    Curl_pgrsSetDownloadSize(data, expected_size);

  if(data->reqdata.resume_from)
    lseek(fd, data->reqdata.resume_from, SEEK_SET);
  if(data->reqdata.resume_from) {
    if(data->reqdata.resume_from !=
       lseek(fd, data->reqdata.resume_from, SEEK_SET))
      return CURLE_BAD_DOWNLOAD_RESUME;
  }

  Curl_pgrsTime(data, TIMER_STARTTRANSFER);