diff options
author | David Oberhollenzer <goliath@infraroot.at> | 2020-03-31 18:19:27 +0200 |
---|---|---|
committer | David Oberhollenzer <goliath@infraroot.at> | 2020-03-31 18:19:27 +0200 |
commit | 87a524d9313428d55e5a04c2538042629bdc467a (patch) | |
tree | 37d513ffcb56666d6993bc27096144896cedfc32 /lib/init/rdsvc.c | |
parent | 9f9807d4d3e0ecabc9bb67658d58644d714a9fd7 (diff) |
cleanup: delete remains of libutil
- exec_t belongs to service.h, the main place where it is used/needed
- code for executing exec_t is moved to runsvc for the same reason
- what is left are NORETURN and ARRAY_SIZE
- the former can be replaced with direct attribute usage since
the only relevant compilers all support the attribute.
- the later is only used in 3 places and can be trivially replaced
with direct usage of sizeof().
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
Diffstat (limited to 'lib/init/rdsvc.c')
-rw-r--r-- | lib/init/rdsvc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/init/rdsvc.c b/lib/init/rdsvc.c index 27ce5e5..40e73bc 100644 --- a/lib/init/rdsvc.c +++ b/lib/init/rdsvc.c @@ -11,7 +11,6 @@ #include "service.h" #include "libcfg.h" -#include "util.h" static int try_unescape(char *arg, rdline_t *rd) { @@ -265,8 +264,10 @@ service_t *rdsvc(int dirfd, const char *filename, int flags) memcpy(svc->name, filename, nlen); svc->id = -1; - if (rdcfg(svc, &rd, svc_params, ARRAY_SIZE(svc_params), flags)) + if (rdcfg(svc, &rd, svc_params, + sizeof(svc_params) / sizeof(svc_params[0]), flags)) { goto fail; + } out: rdline_cleanup(&rd); |