]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fix time_t format
authorRosen Penev <rosenp@gmail.com>
Tue, 3 May 2022 00:53:07 +0000 (17:53 -0700)
committerRosen Penev <rosenp@gmail.com>
Tue, 10 May 2022 20:40:31 +0000 (13:40 -0700)
Use musl's define to test for 64-bit time_t.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
sys-utils/unshare.c

index 755631ff4d75b1c37540370e00114dc9a309d9b8..88306f0f46f9e5a24378ad985a73402c473a67f5 100644 (file)
@@ -217,7 +217,7 @@ static void settime(time_t offset, clockid_t clk_id)
        char buf[sizeof(stringify_value(ULONG_MAX)) * 3];
        int fd, len;
 
-       len = snprintf(buf, sizeof(buf), "%d %ld 0", clk_id, offset);
+       len = snprintf(buf, sizeof(buf), "%d %" PRId64 " 0", clk_id, (int64_t) offset);
 
        fd = open("/proc/self/timens_offsets", O_WRONLY);
        if (fd < 0)