diff mbox series

[1/2] procd/rcS: cast format string to int64_t

Message ID 20200720223527.89436-1-rosenp@gmail.com
State Accepted
Headers show
Series [1/2] procd/rcS: cast format string to int64_t | expand

Commit Message

Rosen Penev July 20, 2020, 10:35 p.m. UTC
musl 1.2.0 turns time_t into a 64-bit value, even on 32-bit. This makes it
compatible.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 rcS.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Paul Oranje Aug. 1, 2020, 1:23 p.m. UTC | #1
See below, bye,
Paul

> Op 21 jul. 2020, om 00:35 heeft Rosen Penev <rosenp@gmail.com> het volgende geschreven:
> 
> musl 1.2.0 turns time_t into a 64-bit value, even on 32-bit.
Also 32-bit systems have to deal with the 2038 end-of-epoch.
diff mbox series

Patch

diff --git a/rcS.c b/rcS.c
index c2e1abb..2851fae 100644
--- a/rcS.c
+++ b/rcS.c
@@ -18,6 +18,7 @@ 
 
 #include <libubox/uloop.h>
 #include <libubox/runqueue.h>
+#include <inttypes.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -118,7 +119,7 @@  static void q_initd_complete(struct runqueue *q, struct runqueue_task *p)
 		ts_res.tv_nsec += 1000000000;
 	}
 
-	DEBUG(2, "stop %s %s - took %lu.%09lus\n", s->file, s->param, ts_res.tv_sec, ts_res.tv_nsec);
+	DEBUG(2, "stop %s %s - took %" PRId64 ".%09" PRId64 "s\n", s->file, s->param, (int64_t)ts_res.tv_sec, (int64_t)ts_res.tv_nsec);
 	ustream_free(&s->fd.stream);
 	close(s->fd.fd.fd);
 	free(s);