summaryrefslogtreecommitdiffstats
path: root/usr.sbin/daemon/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/daemon/daemon.c')
-rw-r--r--usr.sbin/daemon/daemon.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c
index 8b25800..540ebf3 100644
--- a/usr.sbin/daemon/daemon.c
+++ b/usr.sbin/daemon/daemon.c
@@ -79,6 +79,9 @@ main(int argc, char *argv[])
if (argc == 0)
usage();
+ if (user != NULL)
+ restrict_process(user);
+
/*
* Try to open the pidfile before calling daemon(3),
* to be able to report the error intelligently
@@ -94,9 +97,6 @@ main(int argc, char *argv[])
}
}
- if (user != NULL)
- restrict_process(user);
-
if (daemon(nochdir, noclose) == -1)
err(1, NULL);
OpenPOWER on IntegriCloud