mirror of
https://github.com/clearlinux/clr-debug-info.git
synced 2026-09-06 13:51:38 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efeed3e83f | ||
|
|
f5542e7fbb |
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_PREREQ([2.66])
|
AC_PREREQ([2.66])
|
||||||
AC_INIT(clr-debug-info, 38, arjan@linux.intel.com)
|
AC_INIT(clr-debug-info, 42, arjan@linux.intel.com)
|
||||||
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
|
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
|
||||||
AM_SILENT_RULES([yes])
|
AM_SILENT_RULES([yes])
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
|
|||||||
{
|
{
|
||||||
CURLcode code;
|
CURLcode code;
|
||||||
long ret;
|
long ret;
|
||||||
|
long changed;
|
||||||
int fd;
|
int fd;
|
||||||
char filename[PATH_MAX];
|
char filename[PATH_MAX];
|
||||||
CURL *curl = NULL;
|
CURL *curl = NULL;
|
||||||
@@ -203,6 +204,9 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
|
|||||||
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 30);
|
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 30);
|
||||||
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1024);
|
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1024);
|
||||||
|
|
||||||
|
/* request timestamp of files from server */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_FILETIME, 1);
|
||||||
|
|
||||||
if (timestamp) {
|
if (timestamp) {
|
||||||
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
|
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
|
||||||
curl_easy_setopt(curl, CURLOPT_TIMEVALUE, timestamp);
|
curl_easy_setopt(curl, CURLOPT_TIMEVALUE, timestamp);
|
||||||
@@ -230,6 +234,17 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ret == 200) {
|
if (ret == 200) {
|
||||||
|
/* get timestamp, if any */
|
||||||
|
curl_easy_getinfo(curl, CURLINFO_FILETIME, &changed);
|
||||||
|
if (changed >= 0) {
|
||||||
|
struct timespec times[2];
|
||||||
|
times[0].tv_sec = (time_t)changed;
|
||||||
|
times[0].tv_nsec = 0;
|
||||||
|
times[1].tv_sec = (time_t)changed;
|
||||||
|
times[1].tv_nsec = 0;
|
||||||
|
futimens(fd, times);
|
||||||
|
}
|
||||||
|
|
||||||
autofree(char) *command = NULL;
|
autofree(char) *command = NULL;
|
||||||
// printf("Filename is %s\n", filename);
|
// printf("Filename is %s\n", filename);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user