svn commit: trunk/busybox: libbb networking networking/libiproute n etc...

vda at busybox.net vda at busybox.net
Sun Sep 3 12:22:00 UTC 2006


Author: vda
Date: 2006-09-03 05:21:59 -0700 (Sun, 03 Sep 2006)
New Revision: 16034

Log:
replacing func() with xfunc() where appropriate



Modified:
   trunk/busybox/libbb/xfuncs.c
   trunk/busybox/networking/arping.c
   trunk/busybox/networking/fakeidentd.c
   trunk/busybox/networking/libiproute/iptunnel.c
   trunk/busybox/networking/udhcp/common.c
   trunk/busybox/networking/zcip.c


Changeset:
Modified: trunk/busybox/libbb/xfuncs.c
===================================================================
--- trunk/busybox/libbb/xfuncs.c	2006-09-03 12:20:36 UTC (rev 16033)
+++ trunk/busybox/libbb/xfuncs.c	2006-09-03 12:21:59 UTC (rev 16034)
@@ -454,7 +454,7 @@
 /* Die with an error message if we can't daemonize. */
 void xdaemon(int nochdir, int noclose)
 {
-	    if (daemon(nochdir, noclose)) bb_perror_msg_and_die("daemon");
+	if (daemon(nochdir, noclose)) bb_perror_msg_and_die("daemon");
 }
 #endif
 #endif

Modified: trunk/busybox/networking/arping.c
===================================================================
--- trunk/busybox/networking/arping.c	2006-09-03 12:20:36 UTC (rev 16033)
+++ trunk/busybox/networking/arping.c	2006-09-03 12:21:59 UTC (rev 16034)
@@ -259,7 +259,7 @@
 	char *source = NULL;
 	char *target;
 
-	s = socket(PF_PACKET, SOCK_DGRAM, 0);
+	s = xsocket(PF_PACKET, SOCK_DGRAM, 0);
 	ifindex = errno;
 
 	// Drop suid root privileges
@@ -346,11 +346,8 @@
 
 	if (!(cfg&dad) || src.s_addr) {
 		struct sockaddr_in saddr;
-		int probe_fd = socket(AF_INET, SOCK_DGRAM, 0); /* maybe use bb_xsocket? */
+		int probe_fd = xsocket(AF_INET, SOCK_DGRAM, 0);
 
-		if (probe_fd < 0) {
-			bb_error_msg_and_die("socket");
-		}
 		if (device) {
 			if (setsockopt
 				(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device,

Modified: trunk/busybox/networking/fakeidentd.c
===================================================================
--- trunk/busybox/networking/fakeidentd.c	2006-09-03 12:20:36 UTC (rev 16033)
+++ trunk/busybox/networking/fakeidentd.c	2006-09-03 12:21:59 UTC (rev 16034)
@@ -135,7 +135,7 @@
 
 	switch (fork()) {
 	case -1:
-		bb_perror_msg_and_die("Could not fork");
+		bb_perror_msg_and_die("fork");
 
 	case 0:
 		pw = getpwnam(nobodystr);

Modified: trunk/busybox/networking/libiproute/iptunnel.c
===================================================================
--- trunk/busybox/networking/libiproute/iptunnel.c	2006-09-03 12:20:36 UTC (rev 16033)
+++ trunk/busybox/networking/libiproute/iptunnel.c	2006-09-03 12:21:59 UTC (rev 16034)
@@ -43,7 +43,7 @@
 	int fd;
 
 	strcpy(ifr.ifr_name, dev);
-	fd = socket(AF_INET, SOCK_DGRAM, 0);
+	fd = xsocket(AF_INET, SOCK_DGRAM, 0);
 	if (ioctl(fd, SIOCGIFINDEX, &ifr)) {
 		bb_perror_msg("ioctl");
 		return 0;
@@ -58,7 +58,7 @@
 	int fd;
 
 	strcpy(ifr.ifr_name, dev);
-	fd = socket(AF_INET, SOCK_DGRAM, 0);
+	fd = xsocket(AF_INET, SOCK_DGRAM, 0);
 	if (ioctl(fd, SIOCGIFHWADDR, &ifr)) {
 		bb_perror_msg("ioctl");
 		return -1;
@@ -74,7 +74,7 @@
 	int fd;
 
 	ifr.ifr_ifindex = idx;
-	fd = socket(AF_INET, SOCK_DGRAM, 0);
+	fd = xsocket(AF_INET, SOCK_DGRAM, 0);
 	if (ioctl(fd, SIOCGIFNAME, &ifr)) {
 		bb_perror_msg("ioctl");
 		return NULL;
@@ -93,7 +93,7 @@
 
 	strcpy(ifr.ifr_name, basedev);
 	ifr.ifr_ifru.ifru_data = (void*)p;
-	fd = socket(AF_INET, SOCK_DGRAM, 0);
+	fd = xsocket(AF_INET, SOCK_DGRAM, 0);
 	err = ioctl(fd, SIOCGETTUNNEL, &ifr);
 	if (err) {
 		bb_perror_msg("ioctl");
@@ -114,7 +114,7 @@
 		strcpy(ifr.ifr_name, basedev);
 	}
 	ifr.ifr_ifru.ifru_data = (void*)p;
-	fd = socket(AF_INET, SOCK_DGRAM, 0);
+	fd = xsocket(AF_INET, SOCK_DGRAM, 0);
 	err = ioctl(fd, cmd, &ifr);
 	if (err) {
 		bb_perror_msg("ioctl");
@@ -135,7 +135,7 @@
 		strcpy(ifr.ifr_name, basedev);
 	}
 	ifr.ifr_ifru.ifru_data = (void*)p;
-	fd = socket(AF_INET, SOCK_DGRAM, 0);
+	fd = xsocket(AF_INET, SOCK_DGRAM, 0);
 	err = ioctl(fd, SIOCDELTUNNEL, &ifr);
 	if (err) {
 		bb_perror_msg("ioctl");

Modified: trunk/busybox/networking/udhcp/common.c
===================================================================
--- trunk/busybox/networking/udhcp/common.c	2006-09-03 12:20:36 UTC (rev 16033)
+++ trunk/busybox/networking/udhcp/common.c	2006-09-03 12:21:59 UTC (rev 16034)
@@ -59,10 +59,7 @@
 
 	/* hold lock during fork. */
 	pid_fd = pidfile_acquire(pidfile);
-	if (daemon(0, 0) == -1) { /* bb_xdaemon? */
-		perror("fork");
-		exit(1);
-	}
+	xdaemon(0, 0);
 	daemonized++;
 	pidfile_write_release(pid_fd);
 #endif /* __uClinux__ */

Modified: trunk/busybox/networking/zcip.c
===================================================================
--- trunk/busybox/networking/zcip.c	2006-09-03 12:20:36 UTC (rev 16033)
+++ trunk/busybox/networking/zcip.c	2006-09-03 12:21:59 UTC (rev 16034)
@@ -288,10 +288,7 @@
 
 	// daemonize now; don't delay system startup
 	if (!foreground) {
-		if (daemon(0, verbose) < 0) {
-			why = "daemon";
-			goto bad;
-		}
+		xdaemon(0, verbose);
 		syslog(LOG_INFO, "start, interface %s", intf);
 	}
 




More information about the busybox-cvs mailing list