From a8996b9e5268f8ca33deca21e1375a8887c50d40 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 18 Oct 2006 14:47:58 +0000 Subject: use the return code from lseek() to detect problems and bail out if so --- lib/file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/file.c') diff --git a/lib/file.c b/lib/file.c index e9ed5b7f0..602299d01 100644 --- a/lib/file.c +++ b/lib/file.c @@ -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); -- cgit v1.2.3