diff options
author | David Oberhollenzer <goliath@infraroot.at> | 2019-03-19 23:52:28 +0100 |
---|---|---|
committer | David Oberhollenzer <goliath@infraroot.at> | 2019-03-19 23:53:49 +0100 |
commit | 1850f31d6d1d88621b6891ed05c283e26620a242 (patch) | |
tree | 3ab15b200b92226da3f8ee99af8b70133c3468fa /cmd/service/dumpscript.c | |
parent | 065d3b678d58e9e758d19e015b1e25a79a8aaec6 (diff) |
Seperate service loading/error loging from dumpscript command
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
Diffstat (limited to 'cmd/service/dumpscript.c')
-rw-r--r-- | cmd/service/dumpscript.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/cmd/service/dumpscript.c b/cmd/service/dumpscript.c index 7102b5c..23966ee 100644 --- a/cmd/service/dumpscript.c +++ b/cmd/service/dumpscript.c @@ -6,24 +6,6 @@ #include <errno.h> #include "servicecmd.h" -#include "service.h" - -static service_t *try_load(const char *directory, const char *filename) -{ - service_t *svc; - int dirfd; - - dirfd = open(directory, O_RDONLY | O_DIRECTORY); - - if (dirfd < 0) { - perror(directory); - return NULL; - } - - svc = rdsvc(dirfd, filename, 0); - close(dirfd); - return svc; -} enum { NEED_QUOTES = 0x01, @@ -111,7 +93,7 @@ static int cmd_dumpscript(int argc, char **argv) strcat(filename, argv[i]); } - svc = try_load(SVCDIR, filename); + svc = loadsvc(SVCDIR, filename, 0); if (svc == NULL) { fprintf(stderr, "Could not load service '%s'\n", filename); |