* Copyright (c) 1987-2011 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdep.h"
#include "ctdl_module.h"
-#ifndef HAVE_SNPRINTF
-#include <stdarg.h>
-#include "snprintf.h"
-#endif
int DebugModules = 0;
{
MODM_syslog(LOG_DEBUG, "Destroyed cleanup function\n");
p = cur->next;
+ cur->h_function_pointer();
free(cur);
cur = p;
}
void CtdlDestroyServiceHook(void)
{
+ const char *Text;
ServiceFunctionHook *cur, *p;
cur = ServiceHookTable;
while (cur != NULL)
{
- close(cur->msock);
+ if (cur->msock != -1)
+ {
+ close(cur->msock);
+ Text = "Closed";
+ }
+ else
+ {
+ Text = " Not closing again";
+ }
+
if (cur->sockpath) {
- MOD_syslog(LOG_INFO, "Closed UNIX domain socket %s\n",
+ MOD_syslog(LOG_INFO, "%s UNIX domain socket %s\n",
+ Text,
cur->sockpath);
unlink(cur->sockpath);
} else if (cur->tcp_port) {
- MOD_syslog(LOG_INFO, "Closed TCP port %d\n", cur->tcp_port);
+ MOD_syslog(LOG_INFO, "%s TCP port %d\n", Text, cur->tcp_port);
} else {
MOD_syslog(LOG_INFO, "Destroyed service \"%s\"\n", cur->ServiceName);
}