X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Funixsock.c;h=12ebc0995cf0d2bfe85ca9c56768ca83988f8c92;hb=931a471d277b43e455e304c00322168c7c6240e7;hp=f6dbf7305d54e47517cb62557d4e68f559983d9f;hpb=a5d35f85f20ae416c0d29f153e47ca7962d08c95;p=collectd.git diff --git a/src/unixsock.c b/src/unixsock.c index f6dbf730..12ebc099 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 = NULL; +static pthread_t listen_thread = (pthread_t) 0; /* Linked list and auxilliary variables for saving values */ static value_cache_t *cache_head = NULL; @@ -654,10 +654,11 @@ static int us_shutdown (void) { void *ret; - if (listen_thread != NULL) + if (listen_thread != (pthread_t) 0) { pthread_kill (listen_thread, SIGTERM); pthread_join (listen_thread, &ret); + listen_thread = (pthread_t) 0; } plugin_unregister_init ("unixsock");