]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
kmod-setup: don't print warning on -ENOSYS 166/head
authorDaniel Mack <daniel@zonque.org>
Thu, 11 Jun 2015 11:10:39 +0000 (13:10 +0200)
committerDaniel Mack <daniel@zonque.org>
Thu, 11 Jun 2015 14:49:24 +0000 (16:49 +0200)
-ENOSYS is returned from kmod_module_probe_insert_module() if a module isn't
available, not -ENOENT. Don't spit out a warning in that case unless the
warn_if_unavailable flag is set.

Also factor out the condition into an own variable for better readability.

src/core/kmod-setup.c

index d956f9b190be8aa72d0c86ec1bd2d8f5e4155130..f5584b6b14fda98f7c18c5d668b3939ad0477516 100644 (file)
@@ -117,10 +117,12 @@ int kmod_setup(void) {
                         log_info("Inserted module '%s'", kmod_module_get_name(mod));
                 else if (r == KMOD_PROBE_APPLY_BLACKLIST)
                         log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
-                else
-                        log_full_errno((kmod_table[i].warn_if_unavailable || (r < 0 && r != -ENOENT)) ? LOG_WARNING : LOG_DEBUG,
-                                       r,
+                else {
+                        bool print_warning = kmod_table[i].warn_if_unavailable || (r < 0 && r != -ENOSYS);
+
+                        log_full_errno(print_warning ? LOG_WARNING : LOG_DEBUG, r,
                                        "Failed to insert module '%s': %m", kmod_module_get_name(mod));
+                }
 
                 kmod_module_unref(mod);
         }