remove commented out #includes etc

move get_hz to the only caller
This commit is contained in:
Denis Vlasenko
2006-12-31 18:58:32 +00:00
parent 98ee06d3d4
commit 13463af29f
6 changed files with 22 additions and 42 deletions

View File

@@ -57,6 +57,28 @@ static int flush_update(void)
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)
{