From 4978467a703210764bc7b2524d1e4f53013dfafa Mon Sep 17 00:00:00 2001 From: WHR Date: Tue, 19 Dec 2023 17:50:47 +0800 Subject: [PATCH] Check availability of CLOCK_BOOTTIME before using it --- libuptimed/urec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libuptimed/urec.c b/libuptimed/urec.c index e2b6622..5b910ce 100644 --- a/libuptimed/urec.c +++ b/libuptimed/urec.c @@ -136,10 +136,10 @@ time_t read_uptime(void) { double upseconds = 0; struct sysinfo si; - +#ifdef CLOCK_BOOTTIME if (clock_gettime(CLOCK_BOOTTIME, &ts) == 0) return ts.tv_sec; - +#endif /* clock_gettime() failed */ f=fopen("/proc/uptime", "r");