mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-27 10:25:06 +03:00
kmod-setup: don't print warning on -ENOSYS
-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.
This commit is contained in:
parent
512b85af26
commit
78d298bbc5
@ -117,10 +117,12 @@ int kmod_setup(void) {
|
|||||||
log_info("Inserted module '%s'", kmod_module_get_name(mod));
|
log_info("Inserted module '%s'", kmod_module_get_name(mod));
|
||||||
else if (r == KMOD_PROBE_APPLY_BLACKLIST)
|
else if (r == KMOD_PROBE_APPLY_BLACKLIST)
|
||||||
log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
|
log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
|
||||||
else
|
else {
|
||||||
log_full_errno((kmod_table[i].warn_if_unavailable || (r < 0 && r != -ENOENT)) ? LOG_WARNING : LOG_DEBUG,
|
bool print_warning = kmod_table[i].warn_if_unavailable || (r < 0 && r != -ENOSYS);
|
||||||
r,
|
|
||||||
|
log_full_errno(print_warning ? LOG_WARNING : LOG_DEBUG, r,
|
||||||
"Failed to insert module '%s': %m", kmod_module_get_name(mod));
|
"Failed to insert module '%s': %m", kmod_module_get_name(mod));
|
||||||
|
}
|
||||||
|
|
||||||
kmod_module_unref(mod);
|
kmod_module_unref(mod);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user