summaryrefslogtreecommitdiff
path: root/cmd/runsvc
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-11-04 15:02:11 +0100
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-11-04 15:02:11 +0100
commitc0e8c7e245c09598478302155b37a15f3370571f (patch)
treec2e4d7d62f00c8de12d08d9d469b8c31b3f1e21d /cmd/runsvc
parent074fe20a4761e284af2aa46f978f48410cfa60c5 (diff)
cleanup: let rdline_init open the file
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'cmd/runsvc')
-rw-r--r--cmd/runsvc/env.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/cmd/runsvc/env.c b/cmd/runsvc/env.c
index 1e73ee4..e58d803 100644
--- a/cmd/runsvc/env.c
+++ b/cmd/runsvc/env.c
@@ -86,17 +86,12 @@ static struct entry *list_from_file(void)
{
struct entry *list;
rdline_t rd;
- int fd;
- fd = open(ENVFILE, O_RDONLY);
- if (fd < 0) {
- perror(ENVFILE);
+ if (rdline_init(&rd, AT_FDCWD, ENVFILE, 0, NULL))
return NULL;
- }
- rdline_init(&rd, fd, ENVFILE, 0, NULL);
list = parse_list(&rd);
- close(fd);
+ rdline_cleanup(&rd);
return list;
}