]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/modules-load/modules-load.c
util-lib: various improvements to kernel command line parsing
[thirdparty/systemd.git] / src / modules-load / modules-load.c
index 0901fea8dc35e5f97be5d5f5baeb282222bde766..615998a6f60d679a04e2c87b0716e3e18ed9e801 100644 (file)
@@ -62,7 +62,11 @@ static int add_modules(const char *p) {
 static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
         int r;
 
-        if (streq(key, "modules-load") && value) {
+        if (proc_cmdline_key_streq(key, "modules_load")) {
+
+                if (proc_cmdline_value_missing(key, value))
+                        return 0;
+
                 r = add_modules(value);
                 if (r < 0)
                         return r;
@@ -226,7 +230,7 @@ int main(int argc, char *argv[]) {
 
         umask(0022);
 
-        r = parse_proc_cmdline(parse_proc_cmdline_item, NULL, true);
+        r = proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_STRIP_RD_PREFIX);
         if (r < 0)
                 log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");