svn commit: trunk/busybox/networking/libiproute

vda at busybox.net vda at busybox.net
Sun Dec 31 19:07:24 UTC 2006


Author: vda
Date: 2006-12-31 11:07:23 -0800 (Sun, 31 Dec 2006)
New Revision: 17119

Log:
iproute: remove double get_hz optimization


Modified:
   trunk/busybox/networking/libiproute/iproute.c


Changeset:
Modified: trunk/busybox/networking/libiproute/iproute.c
===================================================================
--- trunk/busybox/networking/libiproute/iproute.c	2006-12-31 18:58:32 UTC (rev 17118)
+++ trunk/busybox/networking/libiproute/iproute.c	2006-12-31 19:07:23 UTC (rev 17119)
@@ -57,9 +57,9 @@
 	return 0;
 }
 
-static int get_hz(void)
+static unsigned get_hz(void)
 {
-	static int hz_internal;
+	static unsigned hz_internal;
 	FILE *fp;
 
 	if (hz_internal)
@@ -272,15 +272,11 @@
 			ci = RTA_DATA(tb[RTA_CACHEINFO]);
 		}
 		if ((r->rtm_flags & RTM_F_CLONED) || (ci && ci->rta_expires)) {
-			static int hz;
-			if (!hz) {
-				hz = get_hz();
-			}
 			if (r->rtm_flags & RTM_F_CLONED) {
 				fprintf(fp, "%s    cache ", _SL_);
 			}
 			if (ci->rta_expires) {
-				fprintf(fp, " expires %dsec", ci->rta_expires/hz);
+				fprintf(fp, " expires %dsec", ci->rta_expires / get_hz());
 			}
 			if (ci->rta_error != 0) {
 				fprintf(fp, " error %d", ci->rta_error);




More information about the busybox-cvs mailing list