svn commit: trunk/busybox/procps

vda at busybox.net vda at busybox.net
Wed Oct 15 13:50:25 UTC 2008


Author: vda
Date: 2008-10-15 06:50:24 -0700 (Wed, 15 Oct 2008)
New Revision: 23690

Log:
sysctl: sysctl -a was still misbehaving, fix it



Modified:
   trunk/busybox/procps/sysctl.c


Changeset:
Modified: trunk/busybox/procps/sysctl.c
===================================================================
--- trunk/busybox/procps/sysctl.c	2008-10-15 13:48:30 UTC (rev 23689)
+++ trunk/busybox/procps/sysctl.c	2008-10-15 13:50:24 UTC (rev 23690)
@@ -235,9 +235,12 @@
 
 static void sysctl_dots_to_slashes(char *name)
 {
-	char *cptr, *last_good;
-	char *end = name + strlen(name) - 1;
+	char *cptr, *last_good, *end;
 
+	/* It can be good as-is! */
+	if (access(name, F_OK) == 0)
+		return;
+
 	/* Example from bug 3894:
 	 * net.ipv4.conf.eth0.100.mc_forwarding ->
 	 * net/ipv4/conf/eth0.100/mc_forwarding. NB:
@@ -246,6 +249,7 @@
 	 * we replaced even one . -> /, start over again,
 	 * but never replace dots before the position
 	 * where replacement occurred. */
+	end = name + strlen(name) - 1;
 	last_good = name - 1;
  again:
 	cptr = end;




More information about the busybox-cvs mailing list