libkmod-module: probe: Fix ignore-loaded flag not being applied

This commit is contained in:
Lucas De Marchi 2012-02-07 09:48:59 -02:00
parent e479598b7d
commit 269de2e0bf
2 changed files with 5 additions and 1 deletions

3
TODO
View File

@ -38,6 +38,9 @@ Features:
* Stop using system() inside the library and use fork + exec instead
* Add tests for --show-depends: we need to first trap calls to
kmod_module_get_path(), because it's printed to stdout/stderr.
Known Bugs:
===========

View File

@ -1132,7 +1132,8 @@ KMOD_EXPORT int kmod_module_probe_insert_module(struct kmod_module *mod,
if (mod == NULL)
return -ENOENT;
if (module_is_inkernel(mod)) {
if (!(flags & KMOD_PROBE_IGNORE_LOADED)
&& module_is_inkernel(mod)) {
if (flags & KMOD_PROBE_FAIL_ON_LOADED)
return -EEXIST;
else