diff --git a/mbtask/taskibc.c b/mbtask/taskibc.c index d2f25f8b..3e23bafb 100644 --- a/mbtask/taskibc.c +++ b/mbtask/taskibc.c @@ -630,25 +630,6 @@ void *ibc_thread(void *dummy) ibc_run = TRUE; while (! T_Shutdown) { - - /* - * First check Shutdown requested - */ - if (T_Shutdown) { - for (tnsl = ncsl; tnsl; tnsl = tnsl->next) { - if (tnsl->state == NCS_CONNECT) { - sprintf(csbuf, "SQUIT %s System shutdown\r\n", tnsl->server); - send_msg(tnsl->socket, tnsl->servaddr_in, tnsl->server, csbuf); - } - } - - /* - * Cleanup - */ - - break; - } - /* * Check neighbour servers state */ @@ -660,6 +641,14 @@ void *ibc_thread(void *dummy) receiver(se); } + Syslog('r', "IBC: start shutdown connections"); + for (tnsl = ncsl; tnsl; tnsl = tnsl->next) { + if (tnsl->state == NCS_CONNECT) { + sprintf(csbuf, "SQUIT %s System shutdown\r\n", tnsl->server); + send_msg(tnsl->socket, tnsl->servaddr_in, tnsl->server, csbuf); + } + } + exit: ibc_run = FALSE; Syslog('+', "IBC thread stopped");