mirror of
https://github.com/clearlinux/clr-debug-info.git
synced 2026-09-06 05:41:43 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9304402e2 | ||
|
|
6e202f13f7 | ||
|
|
6735f8f6ed | ||
|
|
8b3777ab99 | ||
|
|
84350939ef | ||
|
|
72b1120a40 | ||
|
|
d3d5fab301 | ||
|
|
e377433a9d | ||
|
|
afa92c77b1 |
+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, 32, arjan@linux.intel.com)
|
AC_INIT(clr-debug-info, 38, 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
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ void try_to_get(const char *path, int pid, time_t timestamp)
|
|||||||
if (ret == 0 && cred.pid == pid) {
|
if (ret == 0 && cred.pid == pid) {
|
||||||
printf("Recursion\n");
|
printf("Recursion\n");
|
||||||
close(sockfd);
|
close(sockfd);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
command = NULL;
|
command = NULL;
|
||||||
|
|||||||
+1
-1
@@ -113,7 +113,7 @@ bool nc_copy_file(const char *src, const char *dst, mode_t mode, bool remove_tar
|
|||||||
while (true) {
|
while (true) {
|
||||||
if ((r = read(src_fd, &buffer, sizeof(buffer))) < 0) {
|
if ((r = read(src_fd, &buffer, sizeof(buffer))) < 0) {
|
||||||
ret = false;
|
ret = false;
|
||||||
break;
|
goto end;
|
||||||
}
|
}
|
||||||
if (write(dest_fd, buffer, sizeof(buffer)) != r) {
|
if (write(dest_fd, buffer, sizeof(buffer)) != r) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
+7
-5
@@ -123,8 +123,8 @@ static inline unsigned nc_hashmap_get_hash(NcHashmap *self, const void *key)
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool nc_hashmap_insert_bucket(NcHashmap *self, NcHashmapEntry *buckets, int n_buckets,
|
static int nc_hashmap_insert_bucket(NcHashmap *self, NcHashmapEntry *buckets, int n_buckets,
|
||||||
unsigned hash, const void *key, void *value)
|
unsigned hash, const void *key, void *value)
|
||||||
{
|
{
|
||||||
NcHashmapEntry *row = &(buckets[hash % n_buckets]);
|
NcHashmapEntry *row = &(buckets[hash % n_buckets]);
|
||||||
NcHashmapEntry *head = NULL;
|
NcHashmapEntry *head = NULL;
|
||||||
@@ -458,10 +458,12 @@ bool nc_hashmap_iter_next(NcHashmapIter *citer, void **key, void **value)
|
|||||||
}
|
}
|
||||||
item = &(map->buckets[iter->bucket]);
|
item = &(map->buckets[iter->bucket]);
|
||||||
}
|
}
|
||||||
if (item && item->occ) {
|
if (item) {
|
||||||
goto success;
|
if (item->occ) {
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
item = item->next;
|
||||||
}
|
}
|
||||||
item = item->next;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
+13
-2
@@ -191,6 +191,18 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
|
|||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, file);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, file);
|
||||||
curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Some sane timeout values to prevent stalls
|
||||||
|
*
|
||||||
|
* Connect timeout is for first connection to the server.
|
||||||
|
* The low speed timeout is for slow downloads. Since many
|
||||||
|
* files are several mB large, we want to prevent them from
|
||||||
|
* taking forever. (1kB/sec avg over 30secs).
|
||||||
|
*/
|
||||||
|
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 30);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 30);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1024);
|
||||||
|
|
||||||
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);
|
||||||
@@ -225,7 +237,7 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
|
|||||||
stat(filename, &statbuf);
|
stat(filename, &statbuf);
|
||||||
if (statbuf.st_size > 0 &&
|
if (statbuf.st_size > 0 &&
|
||||||
asprintf(&command,
|
asprintf(&command,
|
||||||
"tar -C /var/cache/debuginfo/%s --no-same-owner -xf %s",
|
"tar -C /var/cache/debuginfo/%s --no-same-owner --no-same-permissions -xf %s",
|
||||||
prefix,
|
prefix,
|
||||||
filename) >= 0) {
|
filename) >= 0) {
|
||||||
if (system(command) != 0) {
|
if (system(command) != 0) {
|
||||||
@@ -270,7 +282,6 @@ static void *server_thread(void *arg)
|
|||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
goto thread_end;
|
goto thread_end;
|
||||||
}
|
}
|
||||||
prefix = buf;
|
|
||||||
c = strchr(buf, ':');
|
c = strchr(buf, ':');
|
||||||
if (!c) {
|
if (!c) {
|
||||||
goto thread_end;
|
goto thread_end;
|
||||||
|
|||||||
Reference in New Issue
Block a user