systemctl: use the retval of must_be_root()

This commit is contained in:
Mike Yuan
2024-10-31 15:32:32 +01:00
parent 1f9425d1c4
commit 5aa48b6de1
+3 -4
View File
@@ -180,10 +180,9 @@ int halt_main(void) {
return start_with_fallback();
}
if (geteuid() != 0) {
(void) must_be_root();
return -EPERM;
}
r = must_be_root();
if (r < 0)
return r;
if (!arg_no_wtmp) {
if (sd_booted() > 0)