X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fsysdep.c;h=1caf2ce10b403987d9d8e53df1a3f89cafe44dd7;hb=5ce143deec653885c56c978b03acea9265477297;hp=b59445a850996413b669ab93574c6b6990df29a0;hpb=aa7365c86de8e26e796d3aa3fd605c85d8c26220;p=citadel.git diff --git a/citadel/sysdep.c b/citadel/sysdep.c index b59445a85..1caf2ce10 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -73,10 +73,6 @@ #include #endif -#ifndef HAVE_SNPRINTF -#include "snprintf.h" -#endif - #include "ctdl_module.h" #include "threads.h" #include "user_ops.h" @@ -912,7 +908,8 @@ int client_getln(char *buf, int bufsize) void close_masters (void) { struct ServiceFunctionHook *serviceptr; - + const char *Text; + /* * close all protocol master sockets */ @@ -921,18 +918,37 @@ void close_masters (void) if (serviceptr->tcp_port > 0) { - syslog(LOG_INFO, "Closing %d listener on port %d\n", + if (serviceptr->msock == -1) + Text = "not closing again"; + else + Text = "Closing"; + + syslog(LOG_INFO, "%s %d listener on port %d\n", + Text, serviceptr->msock, serviceptr->tcp_port); serviceptr->tcp_port = 0; } if (serviceptr->sockpath != NULL) - syslog(LOG_INFO, "Closing %d listener on '%s'\n", + { + if (serviceptr->msock == -1) + Text = "not closing again"; + else + Text = "Closing"; + + syslog(LOG_INFO, "%s %d listener on '%s'\n", + Text, serviceptr->msock, serviceptr->sockpath); + } + if (serviceptr->msock != -1) + { close(serviceptr->msock); + serviceptr->msock = -1; + } + /* If it's a Unix domain socket, remove the file. */ if (serviceptr->sockpath != NULL) { unlink(serviceptr->sockpath);