svn commit: trunk/busybox: archival coreutils include miscutils mod etc...

landley at busybox.net landley at busybox.net
Thu Aug 3 17:58:17 UTC 2006


Author: landley
Date: 2006-08-03 10:58:17 -0700 (Thu, 03 Aug 2006)
New Revision: 15770

Log:
These should have been part of 15767 too.


Modified:
   trunk/busybox/archival/cpio.c
   trunk/busybox/archival/gzip.c
   trunk/busybox/archival/tar.c
   trunk/busybox/coreutils/du.c
   trunk/busybox/include/xregex.h
   trunk/busybox/miscutils/eject.c
   trunk/busybox/modutils/lsmod.c
   trunk/busybox/networking/dnsd.c
   trunk/busybox/procps/fuser.c


Changeset:
Modified: trunk/busybox/archival/cpio.c
===================================================================
--- trunk/busybox/archival/cpio.c	2006-08-03 17:54:45 UTC (rev 15769)
+++ trunk/busybox/archival/cpio.c	2006-08-03 17:58:17 UTC (rev 15770)
@@ -67,7 +67,7 @@
 		}
 	}
 	if (cpio_filename) { /* CPIO_OPT_FILE */
-		archive_handle->src_fd = bb_xopen(cpio_filename, O_RDONLY);
+		archive_handle->src_fd = xopen(cpio_filename, O_RDONLY);
 		archive_handle->seek = seek_by_jump;
 	}
 	if (opt & CPIO_OPT_CREATE_LEADING_DIR) {

Modified: trunk/busybox/archival/gzip.c
===================================================================
--- trunk/busybox/archival/gzip.c	2006-08-03 17:54:45 UTC (rev 15769)
+++ trunk/busybox/archival/gzip.c	2006-08-03 17:58:17 UTC (rev 15770)
@@ -1187,7 +1187,7 @@
 	ALLOC(ush, tab_prefix, 1L << BITS);
 
 	/* Initialise the CRC32 table */
-	crc_32_tab = bb_crc32_filltable(0);
+	crc_32_tab = crc32_filltable(0);
 	
 	clear_bufs();
 	part_nb = 0;
@@ -1209,7 +1209,7 @@
 				inFileNum = STDIN_FILENO;
 				outFileNum = STDOUT_FILENO;
 			} else {
-				inFileNum = bb_xopen3(argv[i], O_RDONLY, 0);
+				inFileNum = xopen3(argv[i], O_RDONLY, 0);
 				if (fstat(inFileNum, &statBuf) < 0)
 					bb_perror_msg_and_die("%s", argv[i]);
 				time_stamp = statBuf.st_ctime;

Modified: trunk/busybox/archival/tar.c
===================================================================
--- trunk/busybox/archival/tar.c	2006-08-03 17:54:45 UTC (rev 15769)
+++ trunk/busybox/archival/tar.c	2006-08-03 17:58:17 UTC (rev 15770)
@@ -541,7 +541,7 @@
 	llist_t *newlist = NULL;
 
 	while (cur) {
-		src_stream = bb_xfopen(cur->data, "r");
+		src_stream = xfopen(cur->data, "r");
 		tmp = cur;
 		cur = cur->link;
 		free(tmp);
@@ -824,12 +824,12 @@
 			tar_handle->src_fd = fileno(tar_stream);
 			tar_handle->seek = seek_by_char;
 		} else {
-			tar_handle->src_fd = bb_xopen(tar_filename, flags);
+			tar_handle->src_fd = xopen(tar_filename, flags);
 		}
 	}
 
 	if (base_dir)
-		bb_xchdir(base_dir);
+		xchdir(base_dir);
 
 	/* create an archive */
 	if (ENABLE_FEATURE_TAR_CREATE && (opt & CTX_CREATE)) {

Modified: trunk/busybox/coreutils/du.c
===================================================================
--- trunk/busybox/coreutils/du.c	2006-08-03 17:54:45 UTC (rev 15769)
+++ trunk/busybox/coreutils/du.c	2006-08-03 17:58:17 UTC (rev 15770)
@@ -121,7 +121,7 @@
 		struct dirent *entry;
 		char *newfile;
 
-		dir = bb_opendir(filename);
+		dir = warn_opendir(filename);
 		if (!dir) {
 			status = EXIT_FAILURE;
 			return sum;

Modified: trunk/busybox/include/xregex.h
===================================================================
--- trunk/busybox/include/xregex.h	2006-08-03 17:54:45 UTC (rev 15769)
+++ trunk/busybox/include/xregex.h	2006-08-03 17:58:17 UTC (rev 15770)
@@ -1,30 +1,16 @@
 /* vi: set sw=4 ts=4: */
 /*
- * Busybox xregcomp utility routine
+ * Busybox xregcomp utility routine.  This isn't in libbb.h because the
+ * C library we're linking against may not support regex.h.
  *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
  * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
  * Permission has been granted to redistribute this code under the GPL.
- *
+ * 
+ * Licensed under GPLv2 or later, see file License in this tarball for details.
  */
 #ifndef __BB_REGEX__
 #define __BB_REGEX__
 
-#include <sys/types.h>
 #include <regex.h>
 extern void xregcomp(regex_t *preg, const char *regex, int cflags);
 

Modified: trunk/busybox/miscutils/eject.c
===================================================================
--- trunk/busybox/miscutils/eject.c	2006-08-03 17:54:45 UTC (rev 15769)
+++ trunk/busybox/miscutils/eject.c	2006-08-03 17:58:17 UTC (rev 15770)
@@ -14,9 +14,6 @@
  */
 
 #include "busybox.h"
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
 #include <mntent.h>
 
 /* various defines swiped from linux/cdrom.h */
@@ -40,7 +37,7 @@
 			erase_mtab(m->mnt_fsname);
 		}
 	}
-	if (ioctl(bb_xopen(device, (O_RDONLY | O_NONBLOCK)),
+	if (ioctl(xopen(device, (O_RDONLY | O_NONBLOCK)),
 				(flags ? CDROMCLOSETRAY : CDROMEJECT))) {
 		bb_perror_msg_and_die("%s", device);
 	}

Modified: trunk/busybox/modutils/lsmod.c
===================================================================
--- trunk/busybox/modutils/lsmod.c	2006-08-03 17:54:45 UTC (rev 15769)
+++ trunk/busybox/modutils/lsmod.c	2006-08-03 17:58:17 UTC (rev 15770)
@@ -12,18 +12,18 @@
  */
 
 #include "busybox.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stddef.h>
-#include <errno.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <ctype.h>
-#include <assert.h>
-#include <getopt.h>
-#include <sys/utsname.h>
-#include <sys/file.h>
+//#include <stdlib.h>
+//#include <stdio.h>
+//#include <string.h>
+//#include <stddef.h>
+//#include <errno.h>
+//#include <unistd.h>
+//#include <dirent.h>
+//#include <ctype.h>
+//#include <assert.h>
+//#include <getopt.h>
+//#include <sys/utsname.h>
+//#include <sys/file.h>
 
 
 #ifndef CONFIG_FEATURE_CHECK_TAINTED_MODULE
@@ -151,15 +151,14 @@
 
 int lsmod_main(int argc, char **argv)
 {
+	FILE *file = xfopen("/proc/modules", "r");
+
 	printf("Module                  Size  Used by");
 	check_tainted();
 #if defined(CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT)
 	{
-	  FILE *file;
 	  char line[4096];
 
-	  file = bb_xfopen("/proc/modules", "r");
-
 	  while (fgets(line, sizeof(line), file)) {
 	    char *tok;
 
@@ -190,13 +189,10 @@
 	  }
 	  fclose(file);
 	}
-	return EXIT_SUCCESS;
 #else
-	if (bb_xprint_file_by_name("/proc/modules") == 0)
-		return EXIT_SUCCESS;
+	xprint_and_close_file(file);
 #endif  /*  CONFIG_FEATURE_2_6_MODULES  */
-
-	return EXIT_FAILURE;
+	return EXIT_SUCCESS;
 }
 
 #endif /* CONFIG_FEATURE_QUERY_MODULE_INTERFACE */

Modified: trunk/busybox/networking/dnsd.c
===================================================================
--- trunk/busybox/networking/dnsd.c	2006-08-03 17:54:45 UTC (rev 15769)
+++ trunk/busybox/networking/dnsd.c	2006-08-03 17:58:17 UTC (rev 15770)
@@ -17,12 +17,6 @@
  * the first porting of oao' scdns to busybox also.
  */
 
-#include <unistd.h>
-#include <string.h>
-#include <signal.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <ctype.h>
 #include "busybox.h"
 
 static char *fileconf = "/etc/dnsd.conf";
@@ -170,7 +164,7 @@
 	struct dns_entry *m, *prev;
 	prev = dnsentry = NULL;
 
-	fp = bb_xfopen(fileconf, "r");
+	fp = xfopen(fileconf, "r");
 
 	while (1) {
 		m = xmalloc(sizeof(struct dns_entry));
@@ -198,7 +192,7 @@
 	char msg[100];
 	int s;
 	int yes = 1;
-	s = bb_xsocket(PF_INET, SOCK_DGRAM, 0);
+	s = xsocket(PF_INET, SOCK_DGRAM, 0);
 #ifdef SO_REUSEADDR
 	if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof(yes)) < 0)
 		bb_perror_msg_and_die("setsockopt() failed");
@@ -208,8 +202,8 @@
 	a.sin_family = AF_INET;
 	if (!inet_aton(iface_addr, &a.sin_addr))
 		bb_perror_msg_and_die("bad iface address");
-	bb_xbind(s, (struct sockaddr *)&a, sizeof(a));
-	listen(s, 50); /* bb_xlisten? */
+	xbind(s, (struct sockaddr *)&a, sizeof(a));
+	xlisten(s, 50); /* xlisten? */
 	sprintf(msg, "accepting UDP packets on addr:port %s:%d\n",
 		iface_addr, (int)listen_port);
 	log_message(LOG_FILE, msg);
@@ -397,7 +391,7 @@
 		/* reexec for vfork() do continue parent */
 		vfork_daemon_rexec(1, 0, argc, argv, "-d");
 #else
-		bb_xdaemon(1, 0);
+		xdaemon(1, 0);
 #endif
 
 	dnsentryinit(is_verbose());

Modified: trunk/busybox/procps/fuser.c
===================================================================
--- trunk/busybox/procps/fuser.c	2006-08-03 17:54:45 UTC (rev 15769)
+++ trunk/busybox/procps/fuser.c	2006-08-03 17:58:17 UTC (rev 15770)
@@ -83,7 +83,7 @@
 	if((sscanf(filename, "%d/%4s", port, tproto)) != 2) return 0;
 	sprintf(path, "%s/net/%s", FUSER_PROC_DIR, tproto);
 	if((access(path, R_OK)) != 0) return 0;
-	*proto = bb_xstrdup(tproto);
+	*proto = xstrdup(tproto);
 	return 1;
 }
 




More information about the busybox-cvs mailing list