]> 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)
committerKarel Zak <kzak@redhat.com>
Wed, 20 Jul 2022 15:41:43 +0000 (17:41 +0200)
Use musl's define to test for 64-bit time_t.

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

index 5effff6b187d34fd2c1683185dc4e4443de3124c..95f1c1bc2a6e6f5855ceca395b084abcb3d9110d 100644 (file)
@@ -215,7 +215,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)