Compare commits

..
1 Commits
14 .. 15
Author SHA1 Message Date
Arjan van de Ven 8844b0b0e1 Revert "Wait with curl init until the first connection comes in"
This reverts commit 6fb3c6f193.
2015-03-05 18:00:06 -05:00
+2 -6
View File
@@ -222,11 +222,11 @@ int main(int argc, char **argv)
int sockfd; int sockfd;
struct sockaddr_un sun; struct sockaddr_un sun;
int ret; int ret;
int curl_done = 0;
if (argc < -1) if (argc < -1)
(void)argv; (void)argv;
curl_global_init(CURL_GLOBAL_ALL);
signal(SIGPIPE,SIG_IGN); signal(SIGPIPE,SIG_IGN);
@@ -235,6 +235,7 @@ int main(int argc, char **argv)
if (access("/var/cache/debuginfo/src/", F_OK)) if (access("/var/cache/debuginfo/src/", F_OK))
system("mkdir -p /var/cache/debuginfo/src/ &> /dev/null"); system("mkdir -p /var/cache/debuginfo/src/ &> /dev/null");
sockfd = socket(AF_UNIX, SOCK_STREAM, 0); sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
if (sockfd < 0) if (sockfd < 0)
return EXIT_FAILURE; return EXIT_FAILURE;
@@ -260,11 +261,6 @@ int main(int argc, char **argv)
pthread_t thread; pthread_t thread;
clientsock = accept(sockfd, NULL, NULL); clientsock = accept(sockfd, NULL, NULL);
if (!curl_done) {
curl_global_init(CURL_GLOBAL_ALL);
curl_done = 1;
}
pthread_create(&thread, NULL, server_thread, (void *)(unsigned long)clientsock); pthread_create(&thread, NULL, server_thread, (void *)(unsigned long)clientsock);
pthread_detach(thread); pthread_detach(thread);