}
config_close(p);
error:
- if (ENABLE_FEATURE_CLEAN_UP)
- RELEASE_CONFIG_BUFFER(modname);
+ RELEASE_CONFIG_BUFFER(modname);
return rc;
}
int rc = -1;
p = config_open2(CONFIG_DEFAULT_DEPMOD_FILE, fopen_for_read);
+ /* Modprobe does not work at all without modprobe.dep,
+ * even if the full module name is given. Returning error here
+ * was making us later confuse user with this message:
+ * "module /full/path/to/existing/file/module.ko not found".
+ * It's better to die immediately, with good message: */
if (p == NULL)
- goto error;
+ bb_perror_msg_and_die("can't open '%s'", CONFIG_DEFAULT_DEPMOD_FILE);
while (config_read(p, tokens, 2, 1, "# \t", PARSE_NORMAL)) {
colon = last_char_is(tokens[0], ':');
rc = bb_init_module(fn, options);
if (rc == 0)
llist_add_to(&loaded, xstrdup(modname));
- if (ENABLE_FEATURE_CLEAN_UP)
- free(options);
+ free(options);
}
- if (ENABLE_FEATURE_CLEAN_UP)
- free(fn);
+ free(fn);
}
-error_not_found:
+ error_not_found:
config_close(p);
-error:
- if (ENABLE_FEATURE_CLEAN_UP)
- RELEASE_CONFIG_BUFFER(modname);
+
if (rc > 0 && !(option_mask32 & INSMOD_OPT_SILENT))
bb_error_msg("failed to %sload module %s: %s",
(option_mask32 & MODPROBE_OPT_REMOVE) ? "un" : "",
module, moderror(rc));
+
+ RELEASE_CONFIG_BUFFER(modname);
return rc;
}
char *realname = llist_pop(&conf->aliases);
if (check_blacklist(conf, realname))
do_modprobe(conf, realname);
- if (ENABLE_FEATURE_CLEAN_UP)
- free(realname);
+ free(realname);
}
}
argv++;
free(proto);
} else { /* FILE */
if (!file_to_dev_inode(*pp, &dev, &inode))
- bb_perror_msg_and_die("can't open %s", *pp);
+ bb_perror_msg_and_die("can't open '%s'", *pp);
ilist = add_inode(ilist, dev, inode);
}
pp++;
if (jp->nprocs == 0) {
close(0);
if (open(bb_dev_null, O_RDONLY) != 0)
- ash_msg_and_raise_error("can't open %s", bb_dev_null);
+ ash_msg_and_raise_error("can't open '%s'", bb_dev_null);
}
}
if (!oldlvl) {
if (fd < 0) {
if (flags & INPUT_NOFILE_OK)
goto out;
- ash_msg_and_raise_error("can't open %s", fname);
+ ash_msg_and_raise_error("can't open '%s'", fname);
}
if (fd < 10) {
fd2 = copyfd(fd, 10);
fp = setmntent(bb_path_mtab_file, "r");
if (!fp) {
if (opt & OPT_ALL)
- bb_error_msg_and_die("can't open %s", bb_path_mtab_file);
+ bb_error_msg_and_die("can't open '%s'", bb_path_mtab_file);
} else {
while (getmntent_r(fp, &me, path, PATH_MAX)) {
/* Match fstype if passed */