From d5cbc1d05cccf476b3ff77faa9b7039d46f16d45 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 12 Dec 2006 10:50:12 +0100 Subject: [PATCH] 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 --- src/email.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.11.0