config_file_action, NULL, NULL, 1);
}
+static const char *humanly_readable_name(struct module_entry *m)
+{
+ /* probed_name may be NULL. modname always exists. */
+ return m->probed_name ? m->probed_name : m->modname;
+}
+
/* Return: similar to bb_init_module:
* 0 on success,
* -errno on open/read error,
if (!(m->flags & MODULE_FLAG_FOUND_IN_MODDEP)) {
if (!(option_mask32 & INSMOD_OPT_SILENT))
- bb_error_msg("module %s not found in modules.dep", m->probed_name);
+ bb_error_msg("module %s not found in modules.dep",
+ humanly_readable_name(m));
return -ENOENT;
}
DBG("do_modprob'ing %s", m->modname);
if (rc) {
if (first) {
bb_error_msg("failed to unload module %s: %s",
- m2->probed_name ? m2->probed_name : m2->modname,
+ humanly_readable_name(m2),
moderror(rc));
break;
}
free(options);
if (rc) {
bb_error_msg("failed to load module %s (%s): %s",
- m2->probed_name ? m2->probed_name : m2->modname,
+ humanly_readable_name(m2),
fn,
moderror(rc)
);
G.num_unresolved_deps--;
llist_add_to(&m->deps, xstrdup(tokens[0]));
if (tokens[1])
- string_to_llist(tokens[1], &m->deps, " ");
+ string_to_llist(tokens[1], &m->deps, " \t");
} else
DBG("skipping dep line");
}
* "If name is NULL, all unused modules marked
* autoclean will be removed".
*/
- if (bb_delete_module(NULL, O_NONBLOCK|O_EXCL) != 0)
+ if (bb_delete_module(NULL, O_NONBLOCK | O_EXCL) != 0)
bb_perror_msg_and_die("rmmod");
}
return EXIT_SUCCESS;