chiark / gitweb /
log.h: new log_oom() -> int -ENOMEM, use it
[elogind.git] / src / modules-load / modules-load.c
index 06e1a8cc84143b519ba6df1c6ea9e34ed5174bad..6aeaf459aff0d65e837b4072ce6cfc006c959336 100644 (file)
@@ -41,7 +41,7 @@ static char **arg_proc_cmdline_modules = NULL;
 static void systemd_kmod_log(void *data, int priority, const char *file, int line,
                              const char *fn, const char *format, va_list args)
 {
-        log_meta(priority, file, line, fn, format, args);
+        log_metav(priority, file, line, fn, format, args);
 }
 #pragma GCC diagnostic pop
 
@@ -49,17 +49,13 @@ static int add_modules(const char *p) {
         char **t, **k;
 
         k = strv_split(p, ",");
-        if (!k) {
-                log_error("Out of memory");
-                return -ENOMEM;
-        }
+        if (!k)
+                return log_oom();
 
         t = strv_merge(arg_proc_cmdline_modules, k);
         strv_free(k);
-        if (!t) {
-                log_error("Out of memory");
-                return -ENOMEM;
-        }
+        if (!t)
+                return log_oom();
 
         strv_free(arg_proc_cmdline_modules);
         arg_proc_cmdline_modules = t;
@@ -90,16 +86,16 @@ static int parse_proc_cmdline(void) {
                         goto finish;
                 }
 
-                if (startswith(word, "driver=")) {
+                if (startswith(word, "modules-load=")) {
 
-                        r = add_modules(word + 7);
+                        r = add_modules(word + 13);
                         if (r < 0)
                                 goto finish;
 
-                } else if (startswith(word, "rd.driver=")) {
+                } else if (startswith(word, "rd.modules-load=")) {
 
                         if (in_initrd()) {
-                                r = add_modules(word + 10);
+                                r = add_modules(word + 16);
                                 if (r < 0)
                                         goto finish;
                         }
@@ -131,7 +127,7 @@ static int load_module(struct kmod_ctx *ctx, const char *m) {
 
         if (!modlist) {
                 log_error("Failed to find module '%s'", m);
-                return r;
+                return -ENOENT;
         }
 
         kmod_list_foreach(itr, modlist) {