err = module_do_install_commands(m, options, &cb);
} else {
- int state = kmod_module_get_initstate(m);
+ int state;
+
+ if (flags & KMOD_PROBE_IGNORE_LOADED)
+ state = -1;
+ else
+ state = kmod_module_get_initstate(m);
if (state == KMOD_MODULE_LIVE ||
state == KMOD_MODULE_COMING ||
break;
}
- DBG(mod->ctx, "Ignoring '%s': "
- "module already loaded\n", m->name);
- free(options);
- continue;
+ DBG(mod->ctx, "Ignoring module '%s': "
+ "already loaded\n", m->name);
+ err = 0;
}
if (print_action != NULL)
print_action(m, false, options ?: "");
KMOD_PROBE_FORCE_VERMAGIC = 0x00001,
KMOD_PROBE_FORCE_MODVERSION = 0x00002,
KMOD_PROBE_IGNORE_COMMAND = 0x00004,
+ KMOD_PROBE_IGNORE_LOADED = 0x00008,
/* codes below can be used in return value, too */
KMOD_PROBE_APPLY_BLACKLIST_ALL = 0x10000,