From beee49e8db308987c19bb16e93f0f8c8b435d773 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 27 Mar 2007 16:31:22 +0200 Subject: [PATCH] network plugin: Fix shutdown code. --- src/network.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/network.c b/src/network.c index b5d8efb4..35ffb393 100644 --- a/src/network.c +++ b/src/network.c @@ -1118,13 +1118,24 @@ static int network_shutdown (void) listen_loop++; - pthread_kill (listen_thread, SIGTERM); - pthread_join (listen_thread, NULL /* no return value */); + if (listen_thread != (pthread_t) 0) + { + pthread_kill (listen_thread, SIGTERM); + pthread_join (listen_thread, NULL /* no return value */); + listen_thread = (pthread_t) 0; + } listen_thread = 0; + /* TODO: Close `sending_sockets' */ + + plugin_unregister_config ("network"); + plugin_unregister_init ("network"); + plugin_unregister_write ("network"); + plugin_unregister_shutdown ("network"); + return (0); -} +} /* int network_shutdown */ static int network_init (void) { -- 2.11.0