aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/0014-time_t-64bit.patch
blob: dbefcc45bcaa78465fe7cf3dbb66c6cd511392e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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.

diff -upr openrc-0.42.1.orig/src/rc/rc-status.c openrc-0.42.1/src/rc/rc-status.c
--- openrc-0.42.1.orig/src/rc/rc-status.c	2021-01-05 18:59:53.610428019 +0100
+++ openrc-0.42.1/src/rc/rc-status.c	2021-01-05 19:00:34.967112000 +0100
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <inttypes.h>
 
 #include "einfo.h"
 #include "queue.h"
@@ -128,12 +129,12 @@ static char *get_uptime(const char *serv
 			}
 			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);
 		}
 	}