From: Florian Forster Date: Wed, 31 Jan 2007 13:40:01 +0000 (+0100) Subject: unixsock plugin: Fix the initialization of the pthread variable under Mac OS X. X-Git-Tag: collectd-4.0.0~209 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a5d35f85f20ae416c0d29f153e47ca7962d08c95;p=collectd.git unixsock plugin: Fix the initialization of the pthread variable under Mac OS X. --- diff --git a/src/unixsock.c b/src/unixsock.c index de1fa4fd..f6dbf730 100644 --- a/src/unixsock.c +++ b/src/unixsock.c @@ -74,7 +74,7 @@ static char *sock_file = NULL; static char *sock_group = NULL; static int sock_perms = S_IRWXU | S_IRWXG; -static pthread_t listen_thread = -1; +static pthread_t listen_thread = NULL; /* Linked list and auxilliary variables for saving values */ static value_cache_t *cache_head = NULL; @@ -654,7 +654,7 @@ static int us_shutdown (void) { void *ret; - if (listen_thread >= 0) + if (listen_thread != NULL) { pthread_kill (listen_thread, SIGTERM); pthread_join (listen_thread, &ret);