Merge pull request #28 from westermo/wmo/2.4

Westermo fixes for services changing type at runtime

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-04-26 09:38:41 +02:00
commit a1e6febc4f
3 files changed
+15 -9

No files matched your search

+8
View File
@@ -648,6 +648,7 @@ int service_register(int type, char *line, time_t mtime, char *username)
id = svc_next_id(cmd);
}
recreate:
#endif
svc = svc_find(cmd, id);
@@ -658,6 +659,13 @@ int service_register(int type, char *line, time_t mtime, char *username)
_e("Out of memory, cannot register service %s", cmd);
return errno = ENOMEM;
}
} else {
if (svc_is_inetd(svc) && type != SVC_TYPE_INETD) {
_d("Service was previously inetd, deregistering ...");
inetd_del(&svc->inetd);
svc_del(svc);
goto recreate;
}
}
svc->log = log;