mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 21:42:40 +07:00
Fix #87: Allow inetd services to be registered with an id != 1
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+4
-3
@@ -524,7 +524,7 @@ void service_runlevel(int newlevel)
|
||||
int service_register(int type, char *cfg, struct rlimit rlimit[], struct timeval *mtime)
|
||||
{
|
||||
int i = 0;
|
||||
int id = 1; /* Default to ID:1 */
|
||||
int id = -1;
|
||||
#ifdef INETD_ENABLED
|
||||
int forking = 0;
|
||||
#endif
|
||||
@@ -633,12 +633,13 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], struct timeval
|
||||
svc = inetd_find_svc(cmd, service, proto);
|
||||
if (svc)
|
||||
goto inetd_setup;
|
||||
|
||||
id = svc_next_id(cmd);
|
||||
}
|
||||
recreate:
|
||||
#endif
|
||||
|
||||
if (id <= 0)
|
||||
id = svc_next_id(cmd);
|
||||
|
||||
svc = svc_find(cmd, id);
|
||||
if (!svc) {
|
||||
_d("Creating new svc for %s id #%d type %d", cmd, id, type);
|
||||
|
||||
Reference in New Issue
Block a user