diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-01-16 22:19:49 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-01-16 22:19:49 +0100 |
commit | 9ce3cfc9309c55cc01018c88c1ca82779fd74431 (patch) | |
tree | e113a963a732f497d0362d3fff9e5b3834d5a175 /methods/https.cc | |
parent | 62d8a765b9b37354efab6ca838cbdb7f347f7cac (diff) |
correct some style/performance/warnings from cppcheck
The most "visible" change is from utime to utimensat/futimens
as the first one isn't part of POSIX anymore.
Reported-By: cppcheck
Git-Dch: Ignore
Diffstat (limited to 'methods/https.cc')
-rw-r--r-- | methods/https.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/methods/https.cc b/methods/https.cc index 2a562434b..e16e36339 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -21,7 +21,6 @@ #include <sys/stat.h> #include <sys/time.h> -#include <utime.h> #include <unistd.h> #include <signal.h> #include <stdio.h> @@ -405,10 +404,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm) curl_easy_getinfo(curl, CURLINFO_FILETIME, &Res.LastModified); if (Res.LastModified != -1) { - struct utimbuf UBuf; - UBuf.actime = Res.LastModified; - UBuf.modtime = Res.LastModified; - utime(File->Name().c_str(),&UBuf); + struct timespec times[2]; + times[0].tv_sec = Res.LastModified; + times[1].tv_sec = Res.LastModified; + times[0].tv_nsec = times[1].tv_nsec = 0; + futimens(File->Fd(), times); } else Res.LastModified = resultStat.st_mtime; |