diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c index 36bda3433ff..7797f36d449 100644 --- a/src/modules-load/modules-load.c +++ b/src/modules-load/modules-load.c @@ -96,6 +96,8 @@ static int apply_file(struct kmod_ctx *ctx, const char *path, bool ignore_enoent continue; k = module_load_and_warn(ctx, l, true); + if (k == -ENOENT) + continue; if (k < 0 && r >= 0) r = k; } @@ -124,7 +126,6 @@ static int help(void) { } static int parse_argv(int argc, char *argv[]) { - enum { ARG_VERSION = 0x100, }; @@ -141,7 +142,6 @@ static int parse_argv(int argc, char *argv[]) { assert(argv); while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) - switch (c) { case 'h': @@ -202,6 +202,8 @@ static int run(int argc, char *argv[]) { STRV_FOREACH(i, arg_proc_cmdline_modules) { k = module_load_and_warn(ctx, *i, true); + if (k == -ENOENT) + continue; if (k < 0 && r == 0) r = k; }