From 25d5de8fd9698fed0fdbbd8949fd4089602b796d Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Wed, 8 Sep 2021 23:50:44 -0600 Subject: fix build under musl 1.2 on 32 bit systems Since musl 1.2 time_t is a 64 bit value, even on 32 bit systems. A hotfix for printing the value is simply using PRIu64 from inttypes.h in the format string. This fixes #446. --- src/rc/rc-status.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/rc') diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c index cd32c091..6c562319 100644 --- a/src/rc/rc-status.c +++ b/src/rc/rc-status.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "einfo.h" #include "queue.h" @@ -128,12 +129,12 @@ static char *get_uptime(const char *service) } if (diff_days > 0) xasprintf(&uptime, - "%ld day(s) %02ld:%02ld:%02ld (%s)", + "%"PRId64" day(s) %02"PRId64":%02"PRId64":%02"PRId64" (%s)", diff_days, diff_hours, diff_mins, diff_secs, start_count); else xasprintf(&uptime, - "%02ld:%02ld:%02ld (%s)", + "%02"PRId64":%02"PRId64":%02"PRId64" (%s)", diff_hours, diff_mins, diff_secs, start_count); } } -- cgit v1.2.3