summaryrefslogtreecommitdiff
path: root/src/nspawn/nspawn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nspawn/nspawn.c')
-rw-r--r--src/nspawn/nspawn.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index f217def92d..51663e28dc 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -3783,11 +3783,10 @@ int main(int argc, char *argv[]) {
if (r <= 0)
goto finish;
- if (geteuid() != 0) {
- log_error("Need to be root.");
- r = -EPERM;
+ r = must_be_root();
+ if (r < 0)
goto finish;
- }
+
r = determine_names();
if (r < 0)
goto finish;