handle 64-bit time_t
32-bit architectures, like ARM, are moving away from using 32-bit
time syscalls in order to avoid the 2038 problem. When compiled
with newer glibc, the timespec struct has 64-bit values. Adjust
time calculation functions to use `time_t` instead of a basic int-type
so that the appropriate length type is used.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ic1cb7f54a41b556f997349bd4dc52c6ba0e6064f
diff --git a/peci_cmds.c b/peci_cmds.c
index e1576eb..673d563 100644
--- a/peci_cmds.c
+++ b/peci_cmds.c
@@ -35,8 +35,8 @@
{
double timeDiff = 0.0;
struct timespec end;
- long seconds = 0;
- long nanoseconds = 0;
+ time_t seconds = 0;
+ time_t nanoseconds = 0;
clock_gettime(CLOCK_REALTIME, &end);
seconds = end.tv_sec - begin.tv_sec;