X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Femail.c;h=8f633cd1d93e75224209d71017f48ff302bfb241;hb=aee87d9c1665ca8823c7489bfc9900ff12e0e177;hp=f79217cbd89b373f42e84b2a10ea98bb193b3b19;hpb=c57f2a191b63ce73fc432befebe9fa3af97c8eb5;p=collectd.git diff --git a/src/email.c b/src/email.c index f79217cb..8f633cd1 100644 --- a/src/email.c +++ b/src/email.c @@ -360,8 +360,8 @@ static void *collect (void *arg) } } /* while (loop) */ - log_debug ("[thread #%5lu] shutting down connection on fd #%i", - pthread_self (), fileno (this->socket)); + log_debug ("Shutting down connection on fd #%i", + fileno (this->socket)); fclose (connection->socket); free (connection); @@ -376,6 +376,7 @@ static void *collect (void *arg) } /* while (1) */ pthread_exit ((void *)0); + return ((void *) 0); } /* static void *collect (void *) */ static void *open_connection (void __attribute__((unused)) *arg) @@ -481,8 +482,8 @@ static void *open_connection (void __attribute__((unused)) *arg) collectors[i] = (collector_t *)smalloc (sizeof (collector_t)); collectors[i]->socket = NULL; - if (0 != (err = pthread_create (&collectors[i]->thread, &ptattr, - collect, collectors[i]))) { + if (0 != (err = plugin_thread_create (&collectors[i]->thread, + &ptattr, collect, collectors[i]))) { char errbuf[1024]; log_err ("pthread_create() failed: %s", sstrerror (errno, errbuf, sizeof (errbuf))); @@ -548,14 +549,16 @@ static void *open_connection (void __attribute__((unused)) *arg) pthread_cond_signal (&conn_available); } - pthread_exit ((void *)0); + + pthread_exit ((void *) 0); + return ((void *) 0); } /* static void *open_connection (void *) */ static int email_init (void) { int err = 0; - if (0 != (err = pthread_create (&connector, NULL, + if (0 != (err = plugin_thread_create (&connector, NULL, open_connection, NULL))) { char errbuf[1024]; disabled = 1;