projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix closing of already closed files
[citadel.git]
/
citadel
/
serv_extensions.c
diff --git
a/citadel/serv_extensions.c
b/citadel/serv_extensions.c
index cf1270cc6f7f4263027405adf887bb610b67070c..a4c58d04883c7ba706a923648ee7fe39b50d1af5 100644
(file)
--- a/
citadel/serv_extensions.c
+++ b/
citadel/serv_extensions.c
@@
-1226,18
+1226,29
@@
void CtdlShutdownServiceHooks(void)
void CtdlDestroyServiceHook(void)
{
void CtdlDestroyServiceHook(void)
{
+ const char *Text;
ServiceFunctionHook *cur, *p;
cur = ServiceHookTable;
while (cur != NULL)
{
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) {
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) {
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);
}
} else {
MOD_syslog(LOG_INFO, "Destroyed service \"%s\"\n", cur->ServiceName);
}