summaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
Diffstat (limited to 'modutils')
-rw-r--r--modutils/insmod.c126
-rw-r--r--modutils/lsmod.c11
-rw-r--r--modutils/modprobe.c36
-rw-r--r--modutils/rmmod.c10
4 files changed, 92 insertions, 91 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 56e78e8..b45357a 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -247,7 +247,7 @@
#ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1;
-#ident "$Id: insmod.c,v 1.96 2003/03/13 18:57:08 andersen Exp $"
+#ident "$Id: insmod.c,v 1.97 2003/03/19 09:12:33 mjn3 Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish
@@ -468,7 +468,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1;
-#ident "$Id: insmod.c,v 1.96 2003/03/13 18:57:08 andersen Exp $"
+#ident "$Id: insmod.c,v 1.97 2003/03/19 09:12:33 mjn3 Exp $"
/* The relocatable object is manipulated using elfin types. */
@@ -769,12 +769,12 @@ static int check_module_name_match(const char *filename, struct stat *statbuf,
if (fullname[0] == '\0')
return (FALSE);
else {
- char *tmp, *tmp1 = xstrdup(filename);
- tmp = get_last_path_component(tmp1);
+ char *tmp, *tmp1 = bb_xstrdup(filename);
+ tmp = bb_get_last_path_component(tmp1);
if (strcmp(tmp, fullname) == 0) {
free(tmp1);
/* Stop searching if we find a match */
- m_filename = xstrdup(filename);
+ m_filename = bb_xstrdup(filename);
return (TRUE);
}
free(tmp1);
@@ -1700,7 +1700,7 @@ obj_add_symbol(struct obj_file *f, const char *name,
/* Don't report an error if the symbol is coming from
the kernel or some external module. */
if (secidx <= SHN_HIRESERVE)
- error_msg("%s multiply defined", name);
+ bb_error_msg("%s multiply defined", name);
return sym;
}
}
@@ -1713,7 +1713,7 @@ obj_add_symbol(struct obj_file *f, const char *name,
if (ELFW(ST_BIND)(info) == STB_LOCAL && symidx != -1) {
if (symidx >= f->local_symtab_size)
- error_msg("local symbol %s with index %ld exceeds local_symtab_size %ld",
+ bb_error_msg("local symbol %s with index %ld exceeds local_symtab_size %ld",
name, (long) symidx, (long) f->local_symtab_size);
else
f->local_symtab[symidx] = sym;
@@ -1996,7 +1996,7 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv)
/* Also check that the parameter was not resolved from the kernel. */
if (sym == NULL || sym->secidx > SHN_HIRESERVE) {
- error_msg("symbol for parameter %s not found", p);
+ bb_error_msg("symbol for parameter %s not found", p);
return 0;
}
@@ -2009,7 +2009,7 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv)
str = alloca(strlen(q));
for (r = str, q++; *q != '"'; ++q, ++r) {
if (*q == '\0') {
- error_msg("improperly terminated string argument for %s", p);
+ bb_error_msg("improperly terminated string argument for %s", p);
return 0;
} else if (*q == '\\')
switch (*++q) {
@@ -2139,9 +2139,9 @@ static int old_get_kernel_symbols(const char *m_name)
nks = get_kernel_syms(NULL);
if (nks <= 0) {
if (nks)
- perror_msg("get_kernel_syms: %s", m_name);
+ bb_perror_msg("get_kernel_syms: %s", m_name);
else
- error_msg("No kernel symbols");
+ bb_error_msg("No kernel symbols");
return 0;
}
@@ -2322,7 +2322,7 @@ old_init_module(const char *m_name, struct obj_file *f,
m_size | (flag_autoclean ? OLD_MOD_AUTOCLEAN
: 0), &routines, symtab);
if (ret)
- perror_msg("init_module: %s", m_name);
+ bb_perror_msg("init_module: %s", m_name);
free(image);
free(symtab);
@@ -2365,7 +2365,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
p = get_modinfo_value(f, key);
key += 5;
if (p == NULL) {
- error_msg("invalid parameter %s", key);
+ bb_error_msg("invalid parameter %s", key);
return 0;
}
@@ -2380,7 +2380,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
/* Also check that the parameter was not resolved from the kernel. */
if (sym == NULL || sym->secidx > SHN_HIRESERVE) {
- error_msg("symbol for parameter %s not found", key);
+ bb_error_msg("symbol for parameter %s not found", key);
return 0;
}
@@ -2408,7 +2408,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
str = alloca(strlen(q));
for (r = str, q++; *q != '"'; ++q, ++r) {
if (*q == '\0') {
- error_msg("improperly terminated string argument for %s",
+ bb_error_msg("improperly terminated string argument for %s",
key);
return 0;
} else if (*q == '\\')
@@ -2502,7 +2502,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
/* Get the size of each member */
/* Probably we should do that outside the loop ? */
if (!isdigit(*(p + 1))) {
- error_msg("parameter type 'c' for %s must be followed by"
+ bb_error_msg("parameter type 'c' for %s must be followed by"
" the maximum size", key);
return 0;
}
@@ -2510,7 +2510,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
/* Check length */
if (strlen(str) >= charssize) {
- error_msg("string too long for %s (max %ld)", key,
+ bb_error_msg("string too long for %s (max %ld)", key,
charssize - 1);
return 0;
}
@@ -2539,7 +2539,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
break;
default:
- error_msg("unknown parameter type '%c' for %s", *p, key);
+ bb_error_msg("unknown parameter type '%c' for %s", *p, key);
return 0;
}
}
@@ -2558,21 +2558,21 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv)
case ',':
if (++n > max) {
- error_msg("too many values for %s (max %d)", key, max);
+ bb_error_msg("too many values for %s (max %d)", key, max);
return 0;
}
++q;
break;
default:
- error_msg("invalid argument syntax for %s", key);
+ bb_error_msg("invalid argument syntax for %s", key);
return 0;
}
}
end_of_arg:
if (n < min) {
- error_msg("too few values for %s (min %d)", key, min);
+ bb_error_msg("too few values for %s (min %d)", key, min);
return 0;
}
@@ -2641,7 +2641,7 @@ static int new_get_kernel_symbols(void)
module_names = xrealloc(module_names, bufsize = ret);
goto retry_modules_load;
}
- perror_msg("QM_MODULES");
+ bb_perror_msg("QM_MODULES");
return 0;
}
@@ -2661,7 +2661,7 @@ static int new_get_kernel_symbols(void)
/* The module was removed out from underneath us. */
continue;
}
- perror_msg("query_module: QM_INFO: %s", mn);
+ bb_perror_msg("query_module: QM_INFO: %s", mn);
return 0;
}
@@ -2676,7 +2676,7 @@ static int new_get_kernel_symbols(void)
/* The module was removed out from underneath us. */
continue;
default:
- perror_msg("query_module: QM_SYMBOLS: %s", mn);
+ bb_perror_msg("query_module: QM_SYMBOLS: %s", mn);
return 0;
}
}
@@ -2702,7 +2702,7 @@ static int new_get_kernel_symbols(void)
syms = xrealloc(syms, bufsize = ret);
goto retry_kern_sym_load;
}
- perror_msg("kernel: QM_SYMBOLS");
+ bb_perror_msg("kernel: QM_SYMBOLS");
return 0;
}
nksyms = nsyms = ret;
@@ -2863,7 +2863,7 @@ new_init_module(const char *m_name, struct obj_file *f,
sec = obj_find_section(f, ".this");
if (!sec || !sec->contents) {
- perror_msg_and_die("corrupt module %s?",m_name);
+ bb_perror_msg_and_die("corrupt module %s?",m_name);
}
module = (struct new_module *) sec->contents;
m_addr = sec->header.sh_addr;
@@ -2927,7 +2927,7 @@ new_init_module(const char *m_name, struct obj_file *f,
ret = new_sys_init_module(m_name, (struct new_module *) image);
if (ret)
- perror_msg("init_module: %s", m_name);
+ bb_perror_msg("init_module: %s", m_name);
free(image);
@@ -3008,7 +3008,7 @@ static int obj_check_undefineds(struct obj_file *f)
sym->value = 0;
} else {
if (!flag_quiet) {
- error_msg("unresolved symbol %s", sym->name);
+ bb_error_msg("unresolved symbol %s", sym->name);
}
ret = 0;
}
@@ -3236,11 +3236,11 @@ static int obj_relocate(struct obj_file *f, ElfW(Addr) base)
errmsg = "Unhandled relocation";
bad_reloc:
if (extsym) {
- error_msg("%s of type %ld for %s", errmsg,
+ bb_error_msg("%s of type %ld for %s", errmsg,
(long) ELFW(R_TYPE) (rel->r_info),
strtab + extsym->st_name);
} else {
- error_msg("%s of type %ld", errmsg,
+ bb_error_msg("%s of type %ld", errmsg,
(long) ELFW(R_TYPE) (rel->r_info));
}
ret = 0;
@@ -3317,7 +3317,7 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits)
fseek(fp, 0, SEEK_SET);
if (fread(&f->header, sizeof(f->header), 1, fp) != 1) {
- perror_msg("error reading ELF header");
+ bb_perror_msg("error reading ELF header");
return NULL;
}
@@ -3325,25 +3325,25 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits)
|| f->header.e_ident[EI_MAG1] != ELFMAG1
|| f->header.e_ident[EI_MAG2] != ELFMAG2
|| f->header.e_ident[EI_MAG3] != ELFMAG3) {
- error_msg("not an ELF file");
+ bb_error_msg("not an ELF file");
return NULL;
}
if (f->header.e_ident[EI_CLASS] != ELFCLASSM
|| f->header.e_ident[EI_DATA] != ELFDATAM
|| f->header.e_ident[EI_VERSION] != EV_CURRENT
|| !MATCH_MACHINE(f->header.e_machine)) {
- error_msg("ELF file not for this architecture");
+ bb_error_msg("ELF file not for this architecture");
return NULL;
}
if (f->header.e_type != ET_REL) {
- error_msg("ELF file not a relocatable object");
+ bb_error_msg("ELF file not a relocatable object");
return NULL;
}
/* Read the section headers. */
if (f->header.e_shentsize != sizeof(ElfW(Shdr))) {
- error_msg("section header size mismatch: %lu != %lu",
+ bb_error_msg("section header size mismatch: %lu != %lu",
(unsigned long) f->header.e_shentsize,
(unsigned long) sizeof(ElfW(Shdr)));
return NULL;
@@ -3356,7 +3356,7 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits)
section_headers = alloca(sizeof(ElfW(Shdr)) * shnum);
fseek(fp, f->header.e_shoff, SEEK_SET);
if (fread(section_headers, sizeof(ElfW(Shdr)), shnum, fp) != shnum) {
- perror_msg("error reading ELF section headers");
+ bb_perror_msg("error reading ELF section headers");
return NULL;
}
@@ -3392,7 +3392,7 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits)
sec->contents = xmalloc(sec->header.sh_size);
fseek(fp, sec->header.sh_offset, SEEK_SET);
if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) {
- perror_msg("error reading ELF section data");
+ bb_perror_msg("error reading ELF section data");
return NULL;
}
} else {
@@ -3402,11 +3402,11 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits)
#if SHT_RELM == SHT_REL
case SHT_RELA:
- error_msg("RELA relocations not supported on this architecture");
+ bb_error_msg("RELA relocations not supported on this architecture");
return NULL;
#else
case SHT_REL:
- error_msg("REL relocations not supported on this architecture");
+ bb_error_msg("REL relocations not supported on this architecture");
return NULL;
#endif
@@ -3419,7 +3419,7 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits)
break;
}
- error_msg("can't handle sections of type %ld",
+ bb_error_msg("can't handle sections of type %ld",
(long) sec->header.sh_type);
return NULL;
}
@@ -3454,7 +3454,7 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits)
ElfW(Sym) * sym;
if (sec->header.sh_entsize != sizeof(ElfW(Sym))) {
- error_msg("symbol size mismatch: %lu != %lu",
+ bb_error_msg("symbol size mismatch: %lu != %lu",
(unsigned long) sec->header.sh_entsize,
(unsigned long) sizeof(ElfW(Sym)));
return NULL;
@@ -3484,7 +3484,7 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits)
case SHT_RELM:
if (sec->header.sh_entsize != sizeof(ElfW(RelM))) {
- error_msg("relocation entry size mismatch: %lu != %lu",
+ bb_error_msg("relocation entry size mismatch: %lu != %lu",
(unsigned long) sec->header.sh_entsize,
(unsigned long) sizeof(ElfW(RelM)));
return NULL;
@@ -3523,7 +3523,7 @@ static int obj_load_progbits(FILE * fp, struct obj_file* f, char* imagebase)
sec->contents = imagebase + (sec->header.sh_addr - base);
fseek(fp, sec->header.sh_offset, SEEK_SET);
if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) {
- error_msg("error reading ELF section data: %s\n", strerror(errno));
+ bb_error_msg("error reading ELF section data: %s\n", strerror(errno));
return 0;
}
@@ -3710,14 +3710,14 @@ add_ksymoops_symbols(struct obj_file *f, const char *filename,
};
if (realpath(filename, real)) {
- absolute_filename = xstrdup(real);
+ absolute_filename = bb_xstrdup(real);
}
else {
int save_errno = errno;
- error_msg("cannot get realpath for %s", filename);
+ bb_error_msg("cannot get realpath for %s", filename);
errno = save_errno;
perror("");
- absolute_filename = xstrdup(filename);
+ absolute_filename = bb_xstrdup(filename);
}
lm_name = strlen(m_name);
@@ -3953,7 +3953,7 @@ extern int insmod_main( int argc, char **argv)
break;
case 'o': /* name the output module */
free(m_name);
- m_name = xstrdup(optarg);
+ m_name = bb_xstrdup(optarg);
break;
case 'L': /* Stub warning */
/* This is needed for compatibility with modprobe.
@@ -3967,16 +3967,16 @@ extern int insmod_main( int argc, char **argv)
break;
#endif
default:
- show_usage();
+ bb_show_usage();
}
}
if (argv[optind] == NULL) {
- show_usage();
+ bb_show_usage();
}
/* Grab the module name */
- tmp1 = xstrdup(argv[optind]);
+ tmp1 = bb_xstrdup(argv[optind]);
tmp = basename(tmp1);
len = strlen(tmp);
@@ -3985,7 +3985,7 @@ extern int insmod_main( int argc, char **argv)
tmp[len] = '\0';
}
- bb_asprintf(&m_fullName, "%s.o", tmp);
+ bb_xasprintf(&m_fullName, "%s.o", tmp);
if (!m_name) {
m_name = tmp;
@@ -4038,19 +4038,19 @@ extern int insmod_main( int argc, char **argv)
if (m_filename == 0
|| ((fp = fopen(m_filename, "r")) == NULL))
{
- error_msg("%s: no module by that name found", m_fullName);
+ bb_error_msg("%s: no module by that name found", m_fullName);
goto out;
}
} else
- error_msg_and_die("%s: no module by that name found", m_fullName);
+ bb_error_msg_and_die("%s: no module by that name found", m_fullName);
}
} else
- m_filename = xstrdup(argv[optind]);
+ m_filename = bb_xstrdup(argv[optind]);
printf("Using %s\n", m_filename);
if ((f = obj_load(fp, LOADBITS)) == NULL)
- perror_msg_and_die("Could not load the module");
+ bb_perror_msg_and_die("Could not load the module");
if (get_modinfo_value(f, "kernel_version") == NULL)
m_has_modinfo = 0;
@@ -4067,7 +4067,7 @@ extern int insmod_main( int argc, char **argv)
} else {
m_version = old_get_module_version(f, m_strversion);
if (m_version == -1) {
- error_msg("couldn't find the kernel version the module was "
+ bb_error_msg("couldn't find the kernel version the module was "
"compiled for");
goto out;
}
@@ -4075,12 +4075,12 @@ extern int insmod_main( int argc, char **argv)
if (strncmp(uts_info.release, m_strversion, STRVERSIONLEN) != 0) {
if (flag_force_load) {
- error_msg("Warning: kernel-module version mismatch\n"
+ bb_error_msg("Warning: kernel-module version mismatch\n"
"\t%s was compiled for kernel version %s\n"
"\twhile this kernel is version %s",
m_filename, m_strversion, uts_info.release);
} else {
- error_msg("kernel-module version mismatch\n"
+ bb_error_msg("kernel-module version mismatch\n"
"\t%s was compiled for kernel version %s\n"
"\twhile this kernel is version %s.",
m_filename, m_strversion, uts_info.release);
@@ -4099,7 +4099,7 @@ extern int insmod_main( int argc, char **argv)
goto out;
k_crcs = new_is_kernel_checksummed();
#else
- error_msg("Not configured to support new kernels");
+ bb_error_msg("Not configured to support new kernels");
goto out;
#endif
} else {
@@ -4108,7 +4108,7 @@ extern int insmod_main( int argc, char **argv)
goto out;
k_crcs = old_is_kernel_checksummed();
#else
- error_msg("Not configured to support old kernels");
+ bb_error_msg("Not configured to support old kernels");
goto out;
#endif
}
@@ -4170,14 +4170,14 @@ extern int insmod_main( int argc, char **argv)
m_addr = create_module(m_name, m_size);
if (m_addr == -1) switch (errno) {
case EEXIST:
- error_msg("A module named %s already exists", m_name);
+ bb_error_msg("A module named %s already exists", m_name);
goto out;
case ENOMEM:
- error_msg("Can't allocate kernel memory for module; needed %lu bytes",
+ bb_error_msg("Can't allocate kernel memory for module; needed %lu bytes",
m_size);
goto out;
default:
- perror_msg("create_module: %s", m_name);
+ bb_perror_msg("create_module: %s", m_name);
goto out;
}
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index b87a26a..bb9947a 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -108,7 +108,7 @@ extern int lsmod_main(int argc, char **argv)
module_names = xmalloc(bufsize = 256);
if (my_query_module(NULL, QM_MODULES, (void **)&module_names, &bufsize,
&nmod)) {
- perror_msg_and_die("QM_MODULES");
+ bb_perror_msg_and_die("QM_MODULES");
}
deps = xmalloc(depsize = 256);
@@ -122,14 +122,14 @@ extern int lsmod_main(int argc, char **argv)
continue;
}
/* else choke */
- perror_msg_and_die("module %s: QM_INFO", mn);
+ bb_perror_msg_and_die("module %s: QM_INFO", mn);
}
if (my_query_module(mn, QM_REFS, (void **)&deps, &depsize, &count)) {
if (errno == ENOENT) {
/* The module was removed out from underneath us. */
continue;
}
- perror_msg_and_die("module %s: QM_REFS", mn);
+ bb_perror_msg_and_die("module %s: QM_REFS", mn);
}
printf("%-20s%8lu%4ld", mn, info.size, info.usecount);
if (info.flags & NEW_MOD_DELETED)
@@ -167,9 +167,10 @@ extern int lsmod_main(int argc, char **argv)
printf("Module Size Used by");
check_tainted();
- if(print_file_by_name("/proc/modules") == FALSE)
+ if (bb_xprint_file_by_name("/proc/modules") < 0) {
+ return 0;
+ }
return 1;
- return 0;
}
#endif /* CONFIG_FEATURE_QUERY_MODULE_INTERFACE */
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index 99650ff..154e662 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -73,7 +73,7 @@ int parse_tag_value ( char *buffer, char **ptag, char **pvalue )
*ptag = tag;
*pvalue = value;
- return xstrlen( tag ) && xstrlen( value );
+ return bb_strlen( tag ) && bb_strlen( value );
}
/* Jump through hoops to simulate how fgets() grabs just one line at a
@@ -119,7 +119,7 @@ static struct dep_t *build_dep ( void )
return 0;
// check for buffer overflow in following code
- if ( xstrlen ( un.release ) > ( sizeof( buffer ) - 64 )) {
+ if ( bb_strlen ( un.release ) > ( sizeof( buffer ) - 64 )) {
return 0;
}
@@ -131,7 +131,7 @@ static struct dep_t *build_dep ( void )
return 0;
while ( reads ( fd, buffer, sizeof( buffer ))) {
- int l = xstrlen ( buffer );
+ int l = bb_strlen ( buffer );
char *p = 0;
while ( isspace ( buffer [l-1] )) {
@@ -163,7 +163,7 @@ static struct dep_t *build_dep ( void )
if (( *(col-2) == '.' ) && ( *(col-1) == 'o' ))
ext = 2;
- mod = xstrndup ( mods, col - mods - ext );
+ mod = bb_xstrndup ( mods, col - mods - ext );
if ( !current ) {
first = current = (struct dep_t *) xmalloc ( sizeof ( struct dep_t ));
@@ -216,7 +216,7 @@ static struct dep_t *build_dep ( void )
if ((end-deps-ext+1) <= 0)
continue;
- dep = xstrndup ( deps, end - deps - ext + 1 );
+ dep = bb_xstrndup ( deps, end - deps - ext + 1 );
current-> m_depcnt++;
current-> m_deparr = (char **) xrealloc ( current-> m_deparr, sizeof ( char *) * current-> m_depcnt );
@@ -247,7 +247,7 @@ static struct dep_t *build_dep ( void )
if ( p )
*p = 0;
- l = xstrlen ( buffer );
+ l = bb_strlen ( buffer );
while ( l && isspace ( buffer [l-1] )) {
buffer [l-1] = 0;
@@ -273,7 +273,7 @@ static struct dep_t *build_dep ( void )
current-> m_next = (struct dep_t *) xmalloc ( sizeof ( struct dep_t ));
current = current-> m_next;
}
- current-> m_module = xstrdup ( alias );
+ current-> m_module = bb_xstrdup ( alias );
current-> m_isalias = 1;
if (( strcmp ( alias, "off" ) == 0 ) || ( strcmp ( alias, "null" ) == 0 )) {
@@ -283,7 +283,7 @@ static struct dep_t *build_dep ( void )
else {
current-> m_depcnt = 1;
current-> m_deparr = xmalloc ( 1 * sizeof( char * ));
- current-> m_deparr[0] = xstrdup ( mod );
+ current-> m_deparr[0] = bb_xstrdup ( mod );
}
current-> m_next = 0;
}
@@ -299,7 +299,7 @@ static struct dep_t *build_dep ( void )
break;
}
if ( dt ) {
- dt-> m_options = xrealloc ( dt-> m_options, xstrlen( opt ) + 1 );
+ dt-> m_options = xrealloc ( dt-> m_options, bb_strlen( opt ) + 1 );
strcpy ( dt-> m_options, opt );
// fprintf ( stderr, "OPTION: '%s' -> '%s'\n", dt-> m_module, dt-> m_options );
@@ -346,7 +346,7 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t *
int lm;
// remove .o extension
- lm = xstrlen ( mod );
+ lm = bb_strlen ( mod );
if (( mod [lm-2] == '.' ) && ( mod [lm-1] == 'o' ))
mod [lm-2] = 0;
@@ -441,7 +441,7 @@ static int mod_insert ( char *mod, int argc, char **argv )
// append module args
for ( i = 0; i < argc; i++ )
- l += ( xstrlen ( argv [i] ) + 1 );
+ l += ( bb_strlen ( argv [i] ) + 1 );
head-> m_options = xrealloc ( head-> m_options, l + 1 );
head-> m_options [0] = 0;
@@ -494,7 +494,7 @@ extern int modprobe_main(int argc, char** argv)
break;
case 'C': // no config used
case 't': // no pattern matching
- error_msg_and_die("-t and -C not supported");
+ bb_error_msg_and_die("-t and -C not supported");
case 'a': // ignore
case 'd': // ignore
@@ -519,7 +519,7 @@ extern int modprobe_main(int argc, char** argv)
break;
case 'V':
default:
- show_usage();
+ bb_show_usage();
break;
}
}
@@ -527,21 +527,21 @@ extern int modprobe_main(int argc, char** argv)
depend = build_dep ( );
if ( !depend )
- error_msg_and_die ( "could not parse modules.dep\n" );
+ bb_error_msg_and_die ( "could not parse modules.dep\n" );
if (remove_opt) {
do {
- mod_remove ( optind < argc ? xstrdup ( argv [optind] ) : NULL );
+ mod_remove ( optind < argc ? bb_xstrdup ( argv [optind] ) : NULL );
} while ( ++optind < argc );
return EXIT_SUCCESS;
}
if (optind >= argc)
- error_msg_and_die ( "No module or pattern provided\n" );
+ bb_error_msg_and_die ( "No module or pattern provided\n" );
- if ( mod_insert ( xstrdup ( argv [optind] ), argc - optind - 1, argv + optind + 1 ))
- error_msg_and_die ( "failed to load module %s", argv [optind] );
+ if ( mod_insert ( bb_xstrdup ( argv [optind] ), argc - optind - 1, argv + optind + 1 ))
+ bb_error_msg_and_die ( "failed to load module %s", argv [optind] );
return EXIT_SUCCESS;
}
diff --git a/modutils/rmmod.c b/modutils/rmmod.c
index 0103d91..3154b30 100644
--- a/modutils/rmmod.c
+++ b/modutils/rmmod.c
@@ -48,11 +48,11 @@ extern int rmmod_main(int argc, char **argv)
buf = xmalloc(bufsize = 256);
while (nmod != pnmod) {
if (delete_module(NULL))
- perror_msg_and_die("rmmod");
+ bb_perror_msg_and_die("rmmod");
pnmod = nmod;
/* 1 == QM_MODULES */
if (my_query_module(NULL, 1, &buf, &bufsize, &nmod)) {
- perror_msg_and_die("QM_MODULES");
+ bb_perror_msg_and_die("QM_MODULES");
}
}
#ifdef CONFIG_FEATURE_CLEAN_UP
@@ -60,16 +60,16 @@ extern int rmmod_main(int argc, char **argv)
#endif
return EXIT_SUCCESS;
default:
- show_usage();
+ bb_show_usage();
}
}
if (optind == argc)
- show_usage();
+ bb_show_usage();
for (n = optind; n < argc; n++) {
if (delete_module(argv[n]) < 0) {
- perror_msg("%s", argv[n]);
+ bb_perror_msg("%s", argv[n]);
ret = EXIT_FAILURE;
}
}