X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmodules-load%2Fmodules-load.c;h=49ee4203ddcb75352098babc083e48559a4349e0;hb=872c8faaf2009422a91d227ae0b5c6f04c9d2c69;hp=28b53ec7a3b71a1d7d151ed9f54f2cb7d0fdcba9;hpb=a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7;p=elogind.git diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c index 28b53ec7a..49ee4203d 100644 --- a/src/modules-load/modules-load.c +++ b/src/modules-load/modules-load.c @@ -76,7 +76,7 @@ static int add_modules(const char *p) { } static int parse_proc_cmdline(void) { - char _cleanup_free_ *line = NULL; + _cleanup_free_ char *line = NULL; char *w, *state; int r; size_t l; @@ -91,7 +91,7 @@ static int parse_proc_cmdline(void) { } FOREACH_WORD_QUOTED(w, l, line, state) { - char _cleanup_free_ *word; + _cleanup_free_ char *word; word = strndup(w, l); if (!word) @@ -148,7 +148,7 @@ static int load_module(struct kmod_ctx *ctx, const char *m) { break; case KMOD_MODULE_LIVE: - log_info("Module '%s' is already loaded", kmod_module_get_name(mod)); + log_debug("Module '%s' is already loaded", kmod_module_get_name(mod)); break; default: @@ -206,7 +206,7 @@ static int apply_file(struct kmod_ctx *ctx, const char *path, bool ignore_enoent l = strstrip(line); if (!*l) continue; - if (strchr(COMMENTS, *l)) + if (strchr(COMMENTS "\n", *l)) continue; k = load_module(ctx, l); @@ -302,8 +302,8 @@ int main(int argc, char *argv[]) { STRV_FOREACH(i, arg_proc_cmdline_modules) { k = load_module(ctx, *i); - if (k < 0) - r = EXIT_FAILURE; + if (k < 0 && r == 0) + r = k; } r = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs);