From: Colin Walters Date: Thu, 14 Dec 2017 20:23:02 +0000 (-0500) Subject: verbs: Rename VERB_OFFLINE to VERB_ONLINE_ONLY, expand MUSTBEROOT X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=bcea5aca80838b704c37fd500896b03c42d1a9b1;p=elogind.git 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?). --- diff --git a/src/basic/verbs.c b/src/basic/verbs.c index 97bb59f5e..ce1d304d9 100644 --- a/src/basic/verbs.c +++ b/src/basic/verbs.c @@ -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; diff --git a/src/basic/verbs.h b/src/basic/verbs.h index a35a3a9fc..d9259fc45 100644 --- a/src/basic/verbs.h +++ b/src/basic/verbs.h @@ -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 {