Browse Source

Initialise libcurl properly.

Con Kolivas 14 years ago
parent
commit
88e2cf7b34
1 changed files with 3 additions and 0 deletions
  1. 3 0
      cpu-miner.c

+ 3 - 0
cpu-miner.c

@@ -1303,6 +1303,8 @@ int main (int argc, char *argv[])
 	if (unlikely(pthread_mutex_init(&get_lock, NULL)))
 	if (unlikely(pthread_mutex_init(&get_lock, NULL)))
 		return 1;
 		return 1;
 
 
+	if (unlikely(curl_global_init(CURL_GLOBAL_ALL)))
+		return 1;
 #ifdef HAVE_SYSLOG_H
 #ifdef HAVE_SYSLOG_H
 	if (use_syslog)
 	if (use_syslog)
 		openlog("cpuminer", LOG_PID, LOG_USER);
 		openlog("cpuminer", LOG_PID, LOG_USER);
@@ -1408,6 +1410,7 @@ int main (int argc, char *argv[])
 
 
 	/* main loop - simply wait for workio thread to exit */
 	/* main loop - simply wait for workio thread to exit */
 	pthread_join(thr_info[work_thr_id].pth, NULL);
 	pthread_join(thr_info[work_thr_id].pth, NULL);
+	curl_global_cleanup();
 
 
 	applog(LOG_INFO, "workio thread dead, exiting.");
 	applog(LOG_INFO, "workio thread dead, exiting.");