svn commit: trunk/busybox: coreutils networking/libiproute

vda at busybox.net vda at busybox.net
Tue Jan 2 16:32:16 UTC 2007


Author: vda
Date: 2007-01-02 08:32:16 -0800 (Tue, 02 Jan 2007)
New Revision: 17131

Log:
Remove networking/libiproute/linux/pkt_sched.h
(and networking/libiproute/linux/ since it become empty).
Style fixes.


Removed:
   trunk/busybox/networking/libiproute/linux/

Modified:
   trunk/busybox/coreutils/tail.c
   trunk/busybox/networking/libiproute/ip_parse_common_args.c
   trunk/busybox/networking/libiproute/iptunnel.c


Changeset:
Modified: trunk/busybox/coreutils/tail.c
===================================================================
--- trunk/busybox/coreutils/tail.c	2007-01-02 05:46:18 UTC (rev 17130)
+++ trunk/busybox/coreutils/tail.c	2007-01-02 16:32:16 UTC (rev 17131)
@@ -163,7 +163,7 @@
 		 * starting file position may not be the beginning of the file.
 		 * Beware of backing up too far.  See example in wc.c.
 		 */
-		if (!(count|from_top) && lseek(fds[i], 0, SEEK_END) >= 0) {
+		if (!(count | from_top) && lseek(fds[i], 0, SEEK_END) >= 0) {
 			continue;
 		}
 

Modified: trunk/busybox/networking/libiproute/ip_parse_common_args.c
===================================================================
--- trunk/busybox/networking/libiproute/ip_parse_common_args.c	2007-01-02 05:46:18 UTC (rev 17130)
+++ trunk/busybox/networking/libiproute/ip_parse_common_args.c	2007-01-02 16:32:16 UTC (rev 17131)
@@ -35,7 +35,8 @@
 		char *opt = argv[1];
 
 		if (strcmp(opt,"--") == 0) {
-			argc--; argv++;
+			argc--;
+			argv++;
 			break;
 		}
 
@@ -69,7 +70,8 @@
 		} else {
 			bb_show_usage();
 		}
-		argc--;	argv++;
+		argc--;
+		argv++;
 	}
 	_SL_ = oneline ? "\\" : "\n" ;
 	*argcp = argc;

Modified: trunk/busybox/networking/libiproute/iptunnel.c
===================================================================
--- trunk/busybox/networking/libiproute/iptunnel.c	2007-01-02 05:46:18 UTC (rev 17130)
+++ trunk/busybox/networking/libiproute/iptunnel.c	2007-01-02 16:32:16 UTC (rev 17131)
@@ -409,46 +409,46 @@
 	if (p->iph.tos) {
 		SPRINT_BUF(b1);
 		printf(" tos");
-		if (p->iph.tos&1)
+		if (p->iph.tos & 1)
 			printf(" inherit");
-		if (p->iph.tos&~1)
-			printf("%c%s ", p->iph.tos&1 ? '/' : ' ',
-			       rtnl_dsfield_n2a(p->iph.tos&~1, b1, sizeof(b1)));
+		if (p->iph.tos & ~1)
+			printf("%c%s ", p->iph.tos & 1 ? '/' : ' ',
+			       rtnl_dsfield_n2a(p->iph.tos & ~1, b1, sizeof(b1)));
 	}
-	if (!(p->iph.frag_off&htons(IP_DF)))
+	if (!(p->iph.frag_off & htons(IP_DF)))
 		printf(" nopmtudisc");
 
-	if ((p->i_flags&GRE_KEY) && (p->o_flags&GRE_KEY) && p->o_key == p->i_key)
+	if ((p->i_flags & GRE_KEY) && (p->o_flags & GRE_KEY) && p->o_key == p->i_key)
 		printf(" key %s", s3);
-	else if ((p->i_flags|p->o_flags)&GRE_KEY) {
-		if (p->i_flags&GRE_KEY)
+	else if ((p->i_flags | p->o_flags) & GRE_KEY) {
+		if (p->i_flags & GRE_KEY)
 			printf(" ikey %s ", s3);
-		if (p->o_flags&GRE_KEY)
+		if (p->o_flags & GRE_KEY)
 			printf(" okey %s ", s4);
 	}
 
-	if (p->i_flags&GRE_SEQ)
+	if (p->i_flags & GRE_SEQ)
 		printf("%s  Drop packets out of sequence.\n", _SL_);
-	if (p->i_flags&GRE_CSUM)
+	if (p->i_flags & GRE_CSUM)
 		printf("%s  Checksum in received packet is required.", _SL_);
-	if (p->o_flags&GRE_SEQ)
+	if (p->o_flags & GRE_SEQ)
 		printf("%s  Sequence packets on output.", _SL_);
-	if (p->o_flags&GRE_CSUM)
+	if (p->o_flags & GRE_CSUM)
 		printf("%s  Checksum output packets.", _SL_);
 }
 
 static int do_tunnels_list(struct ip_tunnel_parm *p)
 {
 	char name[IFNAMSIZ];
-	unsigned long  rx_bytes, rx_packets, rx_errs, rx_drops,
-	rx_fifo, rx_frame,
-	tx_bytes, tx_packets, tx_errs, tx_drops,
-	tx_fifo, tx_colls, tx_carrier, rx_multi;
+	unsigned long rx_bytes, rx_packets, rx_errs, rx_drops,
+		rx_fifo, rx_frame,
+		tx_bytes, tx_packets, tx_errs, tx_drops,
+		tx_fifo, tx_colls, tx_carrier, rx_multi;
 	int type;
 	struct ip_tunnel_parm p1;
-
 	char buf[512];
 	FILE *fp = fopen("/proc/net/dev", "r");
+
 	if (fp == NULL) {
 		perror("fopen");
 		return -1;
@@ -459,8 +459,10 @@
 
 	while (fgets(buf, sizeof(buf), fp) != NULL) {
 		char *ptr;
-		buf[sizeof(buf) - 1] = 0;
-		if ((ptr = strchr(buf, ':')) == NULL ||
+
+		/*buf[sizeof(buf) - 1] = 0; - fgets is safe anyway */
+		ptr = strchr(buf, ':');
+		if (ptr == NULL ||
 		    (*ptr++ = 0, sscanf(buf, "%s", name) != 1)) {
 			bb_error_msg("wrong format of /proc/net/dev. Sorry");
 			return -1;
@@ -541,6 +543,5 @@
 	} else
 		return do_show(0, NULL);
 
-	bb_error_msg("command \"%s\" is unknown", *argv);
-	exit(-1);
+	bb_error_msg_and_die("command \"%s\" is unknown", *argv);
 }




More information about the busybox-cvs mailing list