diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-31 18:58:32 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-31 18:58:32 +0000 |
commit | 13463af29f1fd904cc0ea5e0bd0acdabd8431e53 (patch) | |
tree | 9ec9a96df5df0ee33bb5e31f89f9407d8cf48396 | |
parent | 98ee06d3d46aa7f89c204681c7075b53300a6a6e (diff) | |
download | busybox-w32-13463af29f1fd904cc0ea5e0bd0acdabd8431e53.tar.gz busybox-w32-13463af29f1fd904cc0ea5e0bd0acdabd8431e53.tar.bz2 busybox-w32-13463af29f1fd904cc0ea5e0bd0acdabd8431e53.zip |
remove commented out #includes etc
move get_hz to the only caller
-rw-r--r-- | include/platform.h | 7 | ||||
-rw-r--r-- | networking/libiproute/iproute.c | 22 | ||||
-rw-r--r-- | networking/libiproute/libnetlink.h | 1 | ||||
-rw-r--r-- | networking/libiproute/linux/pkt_sched.h | 2 | ||||
-rw-r--r-- | networking/libiproute/utils.c | 20 | ||||
-rw-r--r-- | networking/libiproute/utils.h | 12 |
6 files changed, 22 insertions, 42 deletions
diff --git a/include/platform.h b/include/platform.h index 9d8df4b7f..91d5f476d 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -133,13 +133,6 @@ typedef int socklen_t; | |||
133 | #endif | 133 | #endif |
134 | 134 | ||
135 | /* ---- Compiler dependent settings ------------------------- */ | 135 | /* ---- Compiler dependent settings ------------------------- */ |
136 | //#ifndef __GNUC__ | ||
137 | //#if defined __INTEL_COMPILER | ||
138 | //__extension__ typedef __signed__ long long __s64; | ||
139 | //__extension__ typedef unsigned long long __u64; | ||
140 | //#endif /* __INTEL_COMPILER */ | ||
141 | //#endif /* ifndef __GNUC__ */ | ||
142 | |||
143 | #if (defined __digital__ && defined __unix__) | 136 | #if (defined __digital__ && defined __unix__) |
144 | # undef HAVE_MNTENT_H | 137 | # undef HAVE_MNTENT_H |
145 | #else | 138 | #else |
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index bf6f95f61..acb5169a4 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -57,6 +57,28 @@ static int flush_update(void) | |||
57 | return 0; | 57 | return 0; |
58 | } | 58 | } |
59 | 59 | ||
60 | static int get_hz(void) | ||
61 | { | ||
62 | static int hz_internal; | ||
63 | FILE *fp; | ||
64 | |||
65 | if (hz_internal) | ||
66 | return hz_internal; | ||
67 | |||
68 | fp = fopen("/proc/net/psched", "r"); | ||
69 | if (fp) { | ||
70 | unsigned nom, denom; | ||
71 | |||
72 | if (fscanf(fp, "%*08x%*08x%08x%08x", &nom, &denom) == 2) | ||
73 | if (nom == 1000000) | ||
74 | hz_internal = denom; | ||
75 | fclose(fp); | ||
76 | } | ||
77 | if (!hz_internal) | ||
78 | hz_internal = sysconf(_SC_CLK_TCK); | ||
79 | return hz_internal; | ||
80 | } | ||
81 | |||
60 | static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED, | 82 | static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED, |
61 | struct nlmsghdr *n, void *arg) | 83 | struct nlmsghdr *n, void *arg) |
62 | { | 84 | { |
diff --git a/networking/libiproute/libnetlink.h b/networking/libiproute/libnetlink.h index bd1913618..6dd242d03 100644 --- a/networking/libiproute/libnetlink.h +++ b/networking/libiproute/libnetlink.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #ifndef __LIBNETLINK_H__ | 2 | #ifndef __LIBNETLINK_H__ |
3 | #define __LIBNETLINK_H__ 1 | 3 | #define __LIBNETLINK_H__ 1 |
4 | 4 | ||
5 | //#include <asm/types.h> | ||
6 | #include <linux/netlink.h> | 5 | #include <linux/netlink.h> |
7 | #include <linux/rtnetlink.h> | 6 | #include <linux/rtnetlink.h> |
8 | 7 | ||
diff --git a/networking/libiproute/linux/pkt_sched.h b/networking/libiproute/linux/pkt_sched.h index 36c0a46e3..012bb5766 100644 --- a/networking/libiproute/linux/pkt_sched.h +++ b/networking/libiproute/linux/pkt_sched.h | |||
@@ -15,8 +15,6 @@ | |||
15 | filler or even bulk. | 15 | filler or even bulk. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | //#include <asm/types.h> | ||
19 | |||
20 | #define TC_PRIO_BESTEFFORT 0 | 18 | #define TC_PRIO_BESTEFFORT 0 |
21 | #define TC_PRIO_FILLER 1 | 19 | #define TC_PRIO_FILLER 1 |
22 | #define TC_PRIO_BULK 2 | 20 | #define TC_PRIO_BULK 2 |
diff --git a/networking/libiproute/utils.c b/networking/libiproute/utils.c index aa60ffd01..7e74e1c4b 100644 --- a/networking/libiproute/utils.c +++ b/networking/libiproute/utils.c | |||
@@ -294,26 +294,6 @@ int inet_addr_match(inet_prefix * a, inet_prefix * b, int bits) | |||
294 | return 0; | 294 | return 0; |
295 | } | 295 | } |
296 | 296 | ||
297 | int __iproute2_hz_internal; | ||
298 | |||
299 | int __get_hz(void) | ||
300 | { | ||
301 | int hz = 0; | ||
302 | FILE *fp = fopen("/proc/net/psched", "r"); | ||
303 | |||
304 | if (fp) { | ||
305 | unsigned nom, denom; | ||
306 | |||
307 | if (fscanf(fp, "%*08x%*08x%08x%08x", &nom, &denom) == 2) | ||
308 | if (nom == 1000000) | ||
309 | hz = denom; | ||
310 | fclose(fp); | ||
311 | } | ||
312 | if (hz) | ||
313 | return hz; | ||
314 | return sysconf(_SC_CLK_TCK); | ||
315 | } | ||
316 | |||
317 | const char *rt_addr_n2a(int af, int ATTRIBUTE_UNUSED len, | 297 | const char *rt_addr_n2a(int af, int ATTRIBUTE_UNUSED len, |
318 | void *addr, char *buf, int buflen) | 298 | void *addr, char *buf, int buflen) |
319 | { | 299 | { |
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h index 3ecbb3abd..c8ac63197 100644 --- a/networking/libiproute/utils.h +++ b/networking/libiproute/utils.h | |||
@@ -3,8 +3,6 @@ | |||
3 | #define __UTILS_H__ 1 | 3 | #define __UTILS_H__ 1 |
4 | 4 | ||
5 | #include "libbb.h" | 5 | #include "libbb.h" |
6 | //#include <asm/types.h> | ||
7 | //#include <resolv.h> | ||
8 | 6 | ||
9 | #include "libnetlink.h" | 7 | #include "libnetlink.h" |
10 | #include "ll_map.h" | 8 | #include "ll_map.h" |
@@ -90,14 +88,4 @@ int dnet_pton(int af, const char *src, void *addr); | |||
90 | const char *ipx_ntop(int af, const void *addr, char *str, size_t len); | 88 | const char *ipx_ntop(int af, const void *addr, char *str, size_t len); |
91 | int ipx_pton(int af, const char *src, void *addr); | 89 | int ipx_pton(int af, const char *src, void *addr); |
92 | 90 | ||
93 | extern int __iproute2_hz_internal; | ||
94 | extern int __get_hz(void); | ||
95 | |||
96 | static inline int get_hz(void) | ||
97 | { | ||
98 | if (__iproute2_hz_internal == 0) | ||
99 | __iproute2_hz_internal = __get_hz(); | ||
100 | return __iproute2_hz_internal; | ||
101 | } | ||
102 | |||
103 | #endif /* __UTILS_H__ */ | 91 | #endif /* __UTILS_H__ */ |