From 93abca8ab5d8674c3c1786fc9988db3a986fa2ed Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sat, 27 Jan 2018 07:47:55 +0100 Subject: [PATCH] Save HZ as an unsigned long integer Number of clock ticks per second is given as a long integer by sysconf() function. It is also saved as an unsigned long integer in sar's data files (sa_hz). Signed-off-by: Sebastien GODARD --- common.c | 4 ++-- common.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common.c b/common.c index 987dff2..d041938 100644 --- a/common.c +++ b/common.c @@ -48,7 +48,7 @@ char units[] = {'s', 'B', 'k', 'M', 'G', 'T', 'P', '?'}; /* Number of ticks per second */ -unsigned int hz; +unsigned long hz; /* Number of bit shifts to convert pages to kB */ unsigned int kb_shift; @@ -641,7 +641,7 @@ void get_HZ(void) perror("sysconf"); } - hz = (unsigned int) ticks; + hz = (unsigned long) ticks; } /* diff --git a/common.h b/common.h index be1aa94..e343a1b 100644 --- a/common.h +++ b/common.h @@ -170,7 +170,7 @@ /* Number of ticks per second */ #define HZ hz -extern unsigned int hz; +extern unsigned long hz; /* Number of bit shifts to convert pages to kB */ extern unsigned int kb_shift; -- 2.40.0