proc-cmdline: make proc_cmdline_get_bool() take flags
All other command line parsers takes flags. Let's make proc_cmdline_get_bool() also take flags. Though, currently, no flag is set by the caller.
This commit is contained in:
@@ -96,7 +96,7 @@ bool cg_is_unified_wanted(void) {
|
||||
return (wanted = r >= CGROUP_UNIFIED_ALL);
|
||||
|
||||
/* If we were explicitly passed systemd.unified_cgroup_hierarchy, respect that. */
|
||||
r = proc_cmdline_get_bool("systemd.unified_cgroup_hierarchy", &b);
|
||||
r = proc_cmdline_get_bool("systemd.unified_cgroup_hierarchy", /* flags = */ 0, &b);
|
||||
if (r > 0)
|
||||
return (wanted = b);
|
||||
|
||||
@@ -147,7 +147,7 @@ bool cg_is_hybrid_wanted(void) {
|
||||
|
||||
/* Otherwise, let's see what the kernel command line has to say. Since checking is expensive, cache
|
||||
* a non-error result. */
|
||||
r = proc_cmdline_get_bool("systemd.legacy_systemd_cgroup_controller", &b);
|
||||
r = proc_cmdline_get_bool("systemd.legacy_systemd_cgroup_controller", /* flags = */ 0, &b);
|
||||
|
||||
/* The meaning of the kernel option is reversed wrt. to the return value of this function, hence the
|
||||
* negation. */
|
||||
|
||||
@@ -748,7 +748,7 @@ static int condition_test_needs_update(Condition *c, char **env) {
|
||||
assert(c->parameter);
|
||||
assert(c->type == CONDITION_NEEDS_UPDATE);
|
||||
|
||||
r = proc_cmdline_get_bool("systemd.condition-needs-update", &b);
|
||||
r = proc_cmdline_get_bool("systemd.condition-needs-update", /* flags = */ 0, &b);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed to parse systemd.condition-needs-update= kernel command line argument, ignoring: %m");
|
||||
if (r > 0)
|
||||
|
||||
@@ -113,7 +113,7 @@ int shall_restore_state(void) {
|
||||
bool ret;
|
||||
int r;
|
||||
|
||||
r = proc_cmdline_get_bool("systemd.restore_state", &ret);
|
||||
r = proc_cmdline_get_bool("systemd.restore_state", /* flags = */ 0, &ret);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user