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:
+3
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user