[BusyBox-cvs] busybox/modutils insmod.c,1.96,1.97 lsmod.c,1.37,1.38 modprobe.c,1.18,1.19 rmmod.c,1.22,1.23

Manuel Novoa III mjn3 at busybox.net
Wed Mar 19 09:13:09 UTC 2003


Update of /var/cvs/busybox/modutils
In directory winder:/home/mjn3/work/busybox/modutils

Modified Files:
	insmod.c lsmod.c modprobe.c rmmod.c 
Log Message:
Major coreutils update.


Index: insmod.c
===================================================================
RCS file: /var/cvs/busybox/modutils/insmod.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- insmod.c	13 Mar 2003 18:57:08 -0000	1.96
+++ insmod.c	19 Mar 2003 09:12:33 -0000	1.97
@@ -769,12 +769,12 @@
 	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 @@
 				/* 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 @@
 
 	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 @@
 
 		/* 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 @@
 			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 @@
 	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 @@
 							  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 @@
 		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 @@
 
 		/* 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 @@
 					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 @@
 					/* 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 @@
 
 					/* 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 @@
 					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 @@
 
 			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 @@
 			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 @@
 					/* 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 @@
 					/* 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 @@
 			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 @@
 
 	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 @@
 
 	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 @@
 					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 @@
 				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 @@
 
 	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 @@
 		|| 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 @@
 	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 @@
 				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 @@
 
 #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 @@
 				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 @@
 				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 @@
 
 		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 @@
 		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 @@
 	};
 
 	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 @@
 				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 @@
 				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 @@
 		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 @@
 				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 @@
 		} 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 @@
 
 		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 @@
 			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 @@
 			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 @@
 	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;
 	}
 

Index: lsmod.c
===================================================================
RCS file: /var/cvs/busybox/modutils/lsmod.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- lsmod.c	11 Jan 2003 18:06:02 -0000	1.37
+++ lsmod.c	19 Mar 2003 09:12:34 -0000	1.38
@@ -108,7 +108,7 @@
 	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 @@
 				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 @@
 	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 */

Index: modprobe.c
===================================================================
RCS file: /var/cvs/busybox/modutils/modprobe.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- modprobe.c	3 Dec 2002 22:41:36 -0000	1.18
+++ modprobe.c	19 Mar 2003 09:12:34 -0000	1.19
@@ -73,7 +73,7 @@
 	*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 @@
 		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 @@
 		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 @@
 				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 @@
 			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 @@
 		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 @@
 						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 @@
 					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 @@
 							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 @@
 	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 @@
 	
 			// 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 @@
 			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 @@
 			break;
 		case 'V':
 		default:
-			show_usage();
+			bb_show_usage();
 			break;
 		}
 	}
@@ -527,21 +527,21 @@
 	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;
 }

Index: rmmod.c
===================================================================
RCS file: /var/cvs/busybox/modutils/rmmod.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- rmmod.c	14 Dec 2002 01:58:59 -0000	1.22
+++ rmmod.c	19 Mar 2003 09:12:34 -0000	1.23
@@ -48,11 +48,11 @@
 				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 @@
 #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;
 		}
 	}




More information about the busybox-cvs mailing list