service: return the svc from service_register()

Settings that exist only in the block format have nowhere to go: the
legacy line cannot carry them, and service_register() returned an errno
that no caller ever read, so conf.c had no handle on the service it just
created.  Return the svc instead, NULL with errno set on failure, errno
zero when a block is skipped on purpose.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-07-30 15:23:36 +02:00
1 parent be28436c2d
commit 6615a248ee
2 files changed
+30 -18

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@
#include "svc.h"
int service_register (int type, char *line, struct rlimit rlimit[], char *file);
svc_t *service_register (int type, char *line, struct rlimit rlimit[], char *file);
void service_unregister (svc_t *svc);
void service_runtask_clean (void);