diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-31 19:07:23 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-31 19:07:23 +0000 |
commit | c519320000972421e6dbc197e504dd1f0c546c1d (patch) | |
tree | a8f3cee2e12dab03da4c8e8eb0494a17bcb18db5 | |
parent | 13463af29f1fd904cc0ea5e0bd0acdabd8431e53 (diff) | |
download | busybox-w32-c519320000972421e6dbc197e504dd1f0c546c1d.tar.gz busybox-w32-c519320000972421e6dbc197e504dd1f0c546c1d.tar.bz2 busybox-w32-c519320000972421e6dbc197e504dd1f0c546c1d.zip |
iproute: remove double get_hz optimization
-rw-r--r-- | networking/libiproute/iproute.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index acb5169a4..2ff99570e 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -57,9 +57,9 @@ static int flush_update(void) | |||
57 | return 0; | 57 | return 0; |
58 | } | 58 | } |
59 | 59 | ||
60 | static int get_hz(void) | 60 | static unsigned get_hz(void) |
61 | { | 61 | { |
62 | static int hz_internal; | 62 | static unsigned hz_internal; |
63 | FILE *fp; | 63 | FILE *fp; |
64 | 64 | ||
65 | if (hz_internal) | 65 | if (hz_internal) |
@@ -272,15 +272,11 @@ static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED, | |||
272 | ci = RTA_DATA(tb[RTA_CACHEINFO]); | 272 | ci = RTA_DATA(tb[RTA_CACHEINFO]); |
273 | } | 273 | } |
274 | if ((r->rtm_flags & RTM_F_CLONED) || (ci && ci->rta_expires)) { | 274 | if ((r->rtm_flags & RTM_F_CLONED) || (ci && ci->rta_expires)) { |
275 | static int hz; | ||
276 | if (!hz) { | ||
277 | hz = get_hz(); | ||
278 | } | ||
279 | if (r->rtm_flags & RTM_F_CLONED) { | 275 | if (r->rtm_flags & RTM_F_CLONED) { |
280 | fprintf(fp, "%s cache ", _SL_); | 276 | fprintf(fp, "%s cache ", _SL_); |
281 | } | 277 | } |
282 | if (ci->rta_expires) { | 278 | if (ci->rta_expires) { |
283 | fprintf(fp, " expires %dsec", ci->rta_expires/hz); | 279 | fprintf(fp, " expires %dsec", ci->rta_expires / get_hz()); |
284 | } | 280 | } |
285 | if (ci->rta_error != 0) { | 281 | if (ci->rta_error != 0) { |
286 | fprintf(fp, " error %d", ci->rta_error); | 282 | fprintf(fp, " error %d", ci->rta_error); |