verbs: Rename VERB_OFFLINE to VERB_ONLINE_ONLY, expand MUSTBEROOT

Followup to previous commit. Suggested by @poettering.
Reindented the `verbs[]` tables to match the apparent previous
whitespace rules (indent to one flag, allow multiple flags to overflow?).
This commit is contained in:
Colin Walters
2017-12-14 16:12:14 -05:00
parent f38951a628
commit c56d1e2c1b
4 changed files with 77 additions and 77 deletions
+2 -2
View File
@@ -126,7 +126,7 @@ int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) {
return -EINVAL;
}
if ((verb->flags & VERB_NOCHROOT) && running_in_chroot_or_offline()) {
if ((verb->flags & VERB_ONLINE_ONLY) && running_in_chroot_or_offline()) {
if (name)
log_info("Running in chroot, ignoring request: %s", name);
else
@@ -134,7 +134,7 @@ int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) {
return 0;
}
if (verb->flags & VERB_MUSTBEROOT) {
if (verb->flags & VERB_MUST_BE_ROOT) {
r = must_be_root();
if (r < 0)
return r;
+3 -3
View File
@@ -23,9 +23,9 @@
#define VERB_ANY ((unsigned) -1)
typedef enum VerbFlags {
VERB_DEFAULT = 1 << 0,
VERB_NOCHROOT = 1 << 1,
VERB_MUSTBEROOT = 1 << 2,
VERB_DEFAULT = 1 << 0,
VERB_ONLINE_ONLY = 1 << 1,
VERB_MUST_BE_ROOT = 1 << 2,
} VerbFlags;
typedef struct {