From: Sebastian Harl Date: Tue, 12 Dec 2006 09:50:12 +0000 (+0100) Subject: email plugin: Kill threads before closing the associated socket X-Git-Tag: collectd-3.11.0~15 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d5cbc1d05cccf476b3ff77faa9b7039d46f16d45;p=collectd.git email plugin: Kill threads before closing the associated socket If the socket is closed before the thread is terminated it might cause some confusing error messages if the thread wants to read from the socket. Signed-off-by: Sebastian Harl --- diff --git a/src/email.c b/src/email.c index 377a6b1e..0f9c2f3d 100644 --- a/src/email.c +++ b/src/email.c @@ -685,15 +685,15 @@ static void email_shutdown (void) if (disabled) return; - close (connector_socket); pthread_kill (connector, SIGTERM); + close (connector_socket); /* don't allow any more connections to be processed */ pthread_mutex_lock (&conns_mutex); for (i = 0; i < max_conns; ++i) { - close (collectors[i]->socket); pthread_kill (collectors[i]->thread, SIGTERM); + close (collectors[i]->socket); } pthread_mutex_unlock (&conns_mutex);