#endif
#if ENABLE_FEATURE_2_6_MODULES
-extern int insmod_ng_main( int argc, char **argv);
+extern int insmod_ng_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
#endif
return FALSE;
else {
char *tmp, *tmp1 = xstrdup(filename);
- tmp = bb_get_last_path_component(tmp1);
+ tmp = bb_get_last_path_component_nostrip(tmp1);
if (strcmp(tmp, fullname) == 0) {
free(tmp1);
/* Stop searching if we find a match */
* linux/include/linux/module.h. Checking for leading "GPL" will not
* work, somebody will use "GPL sucks, this is proprietary".
*/
- static const char * const gpl_licenses[] = {
+ static const char *const gpl_licenses[] = {
"GPL",
"GPL v2",
"GPL and additional rights",
"Dual BSD/GPL",
- "Dual MPL/GPL",
+ "Dual MPL/GPL"
};
sec = obj_find_section(f, ".modinfo");
/* Check if loading this module will taint the kernel. */
static void check_tainted_module(struct obj_file *f, char *m_name)
{
- static const char tainted_file[] = TAINT_FILENAME;
+ static const char tainted_file[] ALIGN1 = TAINT_FILENAME;
+
int fd, kernel_has_tainted;
const char *ptr;
add_ksymoops_symbols(struct obj_file *f, const char *filename,
const char *m_name)
{
- static const char symprefix[] = "__insmod_";
+ static const char symprefix[] ALIGN1 = "__insmod_";
+
struct obj_section *sec;
struct obj_symbol *sym;
char *name, *absolute_filename;
void print_load_map(struct obj_file *f);
#endif
-int insmod_main( int argc, char **argv);
-int insmod_main( int argc, char **argv)
+int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+int insmod_main(int argc, char **argv)
{
char *opt_o, *arg1;
int len;
int m_version, m_crcs;
#endif
#if ENABLE_FEATURE_CLEAN_UP
- FILE *fp = 0;
+ FILE *fp = NULL;
#else
FILE *fp;
#endif
struct utsname myuname;
/* Parse any options */
- getopt32(argc, argv, OPTION_STR, &opt_o);
+ getopt32(argv, OPTION_STR, &opt_o);
arg1 = argv[optind];
if (option_mask32 & OPT_o) { // -o /* name the output module */
free(m_name);
tmp1 = 0; /* flag for free(m_name) before exit() */
}
- /* Get a filedesc for the module. Check we we have a complete path */
+ /* Get a filedesc for the module. Check that we have a complete path */
if (stat(arg1, &st) < 0 || !S_ISREG(st.st_mode)
|| (fp = fopen(arg1, "r")) == NULL
) {
}
/* Check if we have found anything yet */
- if (m_filename == 0 || ((fp = fopen(m_filename, "r")) == NULL)) {
+ if (!m_filename || ((fp = fopen(m_filename, "r")) == NULL)) {
char module_dir[FILENAME_MAX];
free(m_filename);
- m_filename = 0;
- if (realpath (_PATH_MODULES, module_dir) == NULL)
+ m_filename = NULL;
+ if (realpath(_PATH_MODULES, module_dir) == NULL)
strcpy(module_dir, _PATH_MODULES);
/* No module found under /lib/modules/`uname -r`, this
* time cast the net a bit wider. Search /lib/modules/ */
if (m_filename == 0
|| ((fp = fopen(m_filename, "r")) == NULL)
) {
- bb_error_msg("%s: no module by that name found", m_fullName);
+ bb_error_msg("%s: module not found", m_fullName);
goto out;
}
} else
- bb_error_msg_and_die("%s: no module by that name found", m_fullName);
+ bb_error_msg_and_die("%s: module not found", m_fullName);
}
} else
m_filename = xstrdup(arg1);
}
}
-int insmod_ng_main(int argc, char **argv);
+int insmod_ng_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int insmod_ng_main(int argc, char **argv)
{
long ret;