summaryrefslogtreecommitdiff
path: root/networking/libiproute
diff options
context:
space:
mode:
authorDenis Vlasenko2006-12-31 19:07:23 +0000
committerDenis Vlasenko2006-12-31 19:07:23 +0000
commitc519320000972421e6dbc197e504dd1f0c546c1d (patch)
treea8f3cee2e12dab03da4c8e8eb0494a17bcb18db5 /networking/libiproute
parent13463af29f1fd904cc0ea5e0bd0acdabd8431e53 (diff)
downloadbusybox-c519320000972421e6dbc197e504dd1f0c546c1d.zip
busybox-c519320000972421e6dbc197e504dd1f0c546c1d.tar.gz
iproute: remove double get_hz optimization
Diffstat (limited to 'networking/libiproute')
-rw-r--r--networking/libiproute/iproute.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index acb5169..2ff9957 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -57,9 +57,9 @@ static int flush_update(void)
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 @@ static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED,
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);