[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox-cvs
Subject:    svn commit: trunk/busybox: include networking/libiproute networking etc...
From:       vda () busybox ! net (vda at busybox ! net)
Date:       2006-12-31 18:58:33
Message-ID: 20061231185833.1CF0D485AD () busybox ! net
[Download RAW message or body]

Author: vda
Date: 2006-12-31 10:58:32 -0800 (Sun, 31 Dec 2006)
New Revision: 17118

Log:
remove commented out #includes etc
move get_hz to the only caller


Modified:
   trunk/busybox/include/platform.h
   trunk/busybox/networking/libiproute/iproute.c
   trunk/busybox/networking/libiproute/libnetlink.h
   trunk/busybox/networking/libiproute/linux/pkt_sched.h
   trunk/busybox/networking/libiproute/utils.c
   trunk/busybox/networking/libiproute/utils.h


Changeset:
Modified: trunk/busybox/include/platform.h
===================================================================
--- trunk/busybox/include/platform.h	2006-12-31 18:57:37 UTC (rev 17117)
+++ trunk/busybox/include/platform.h	2006-12-31 18:58:32 UTC (rev 17118)
@@ -133,13 +133,6 @@
 #endif
 
 /* ---- Compiler dependent settings ------------------------- */
-//#ifndef __GNUC__
-//#if defined __INTEL_COMPILER
-//__extension__ typedef __signed__ long long __s64;
-//__extension__ typedef unsigned long long __u64;
-//#endif /* __INTEL_COMPILER */
-//#endif /* ifndef __GNUC__ */
-
 #if (defined __digital__ && defined __unix__)
 # undef HAVE_MNTENT_H
 #else

Modified: trunk/busybox/networking/libiproute/iproute.c
===================================================================
--- trunk/busybox/networking/libiproute/iproute.c	2006-12-31 18:57:37 UTC (rev 17117)
+++ trunk/busybox/networking/libiproute/iproute.c	2006-12-31 18:58:32 UTC (rev 17118)
@@ -57,6 +57,28 @@
 	return 0;
 }
 
+static int get_hz(void)
+{
+	static int hz_internal;
+	FILE *fp;
+
+	if (hz_internal)
+		return hz_internal;
+
+	fp = fopen("/proc/net/psched", "r");
+	if (fp) {
+		unsigned nom, denom;
+
+		if (fscanf(fp, "%*08x%*08x%08x%08x", &nom, &denom) == 2)
+			if (nom == 1000000)
+				hz_internal = denom;
+		fclose(fp);
+	}
+	if (!hz_internal)
+		hz_internal = sysconf(_SC_CLK_TCK);
+	return hz_internal;
+}
+
 static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED,
 		struct nlmsghdr *n, void *arg)
 {

Modified: trunk/busybox/networking/libiproute/libnetlink.h
===================================================================
--- trunk/busybox/networking/libiproute/libnetlink.h	2006-12-31 18:57:37 UTC (rev 17117)
+++ trunk/busybox/networking/libiproute/libnetlink.h	2006-12-31 18:58:32 UTC (rev 17118)
@@ -2,7 +2,6 @@
 #ifndef __LIBNETLINK_H__
 #define __LIBNETLINK_H__ 1
 
-//#include <asm/types.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
 

Modified: trunk/busybox/networking/libiproute/linux/pkt_sched.h
===================================================================
--- trunk/busybox/networking/libiproute/linux/pkt_sched.h	2006-12-31 18:57:37 UTC (rev 17117)
+++ trunk/busybox/networking/libiproute/linux/pkt_sched.h	2006-12-31 18:58:32 UTC (rev 17118)
@@ -15,8 +15,6 @@
    filler or even bulk.
  */
 
-//#include <asm/types.h>
-
 #define TC_PRIO_BESTEFFORT		0
 #define TC_PRIO_FILLER			1
 #define TC_PRIO_BULK			2

Modified: trunk/busybox/networking/libiproute/utils.c
===================================================================
--- trunk/busybox/networking/libiproute/utils.c	2006-12-31 18:57:37 UTC (rev 17117)
+++ trunk/busybox/networking/libiproute/utils.c	2006-12-31 18:58:32 UTC (rev 17118)
@@ -294,26 +294,6 @@
 	return 0;
 }
 
-int __iproute2_hz_internal;
-
-int __get_hz(void)
-{
-	int hz = 0;
-	FILE *fp = fopen("/proc/net/psched", "r");
-
-	if (fp) {
-		unsigned nom, denom;
-
-		if (fscanf(fp, "%*08x%*08x%08x%08x", &nom, &denom) == 2)
-			if (nom == 1000000)
-				hz = denom;
-		fclose(fp);
-	}
-	if (hz)
-		return hz;
-	return sysconf(_SC_CLK_TCK);
-}
-
 const char *rt_addr_n2a(int af, int ATTRIBUTE_UNUSED len,
 		void *addr, char *buf, int buflen)
 {

Modified: trunk/busybox/networking/libiproute/utils.h
===================================================================
--- trunk/busybox/networking/libiproute/utils.h	2006-12-31 18:57:37 UTC (rev 17117)
+++ trunk/busybox/networking/libiproute/utils.h	2006-12-31 18:58:32 UTC (rev 17118)
@@ -3,8 +3,6 @@
 #define __UTILS_H__ 1
 
 #include "libbb.h"
-//#include <asm/types.h>
-//#include <resolv.h>
 
 #include "libnetlink.h"
 #include "ll_map.h"
@@ -90,14 +88,4 @@
 const char *ipx_ntop(int af, const void *addr, char *str, size_t len);
 int ipx_pton(int af, const char *src, void *addr);
 
-extern int __iproute2_hz_internal;
-extern int __get_hz(void);
-
-static inline int get_hz(void)
-{
-	if (__iproute2_hz_internal == 0)
-		__iproute2_hz_internal = __get_hz();
-	return __iproute2_hz_internal;
-}
-
 #endif /* __UTILS_H__ */


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic