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:
Yu Watanabe
2023-08-09 17:46:41 +09:00
parent ca15b59f1f
commit 3787934b54
11 changed files with 38 additions and 38 deletions
+2 -2
View File
@@ -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. */
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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;