aboutsummaryrefslogtreecommitdiff
path: root/cmd/runsvc/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/runsvc/env.c')
-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;
}