tree-wide: unify logging of "Must be root" message

Let's unify this in one call, generalizing must_be_root() from
bootctl.c.
This commit is contained in:
Lennart Poettering
2017-12-11 23:19:45 +01:00
parent 4fe2ba0e25
commit fba868fa71
7 changed files with 25 additions and 27 deletions
+3 -4
View File
@@ -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;