return 1;
}
-int curl_parse_http_time(const char *t, time_t *ret) {
+int curl_parse_http_time(const char *t, usec_t *ret) {
struct tm tm;
time_t v;
if (v == (time_t) -1)
return -EINVAL;
- *ret = v;
+ *ret = (usec_t) v * USEC_PER_SEC;
return 0;
}
struct curl_slist *curl_slist_new(const char *first, ...) _sentinel_;
int curl_header_strdup(const void *contents, size_t sz, const char *field, char **value);
-int curl_parse_http_time(const char *t, time_t *ret);
+int curl_parse_http_time(const char *t, usec_t *ret);
DEFINE_TRIVIAL_CLEANUP_FUNC(CURL*, curl_easy_cleanup);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct curl_slist*, curl_slist_free_all);
uint64_t content_length;
uint64_t written;
- time_t mtime;
+ usec_t mtime;
bool force_local;
bool done;
if (f->mtime != 0) {
struct timespec ut[2];
- timespec_store(&ut[0], (usec_t) f->mtime * USEC_PER_SEC);
+ timespec_store(&ut[0], f->mtime);
ut[1] = ut[0];
(void) futimens(f->disk_fd, ut);