diff options
| author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-31 19:07:23 +0000 |
|---|---|---|
| committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-31 19:07:23 +0000 |
| commit | 2c3bd5e1ceb1209903a70ccfbc2d9d4e1709ce6c (patch) | |
| tree | a8f3cee2e12dab03da4c8e8eb0494a17bcb18db5 | |
| parent | 042a13caf7d42d5ec9f8fdf6d8365a028b108088 (diff) | |
| download | busybox-w32-2c3bd5e1ceb1209903a70ccfbc2d9d4e1709ce6c.tar.gz busybox-w32-2c3bd5e1ceb1209903a70ccfbc2d9d4e1709ce6c.tar.bz2 busybox-w32-2c3bd5e1ceb1209903a70ccfbc2d9d4e1709ce6c.zip | |
iproute: remove double get_hz optimization
git-svn-id: svn://busybox.net/trunk/busybox@17119 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -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); |
