]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/pty-session: fix time_t=long assumptions
authorKarel Zak <kzak@redhat.com>
Thu, 6 May 2021 08:13:27 +0000 (10:13 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 May 2021 08:22:07 +0000 (10:22 +0200)
Fixes: https://github.com/karelzak/util-linux/issues/1069
References: http://github.com/karelzak/util-linux/commit/ce3355cc54d97711bc240783324f7ab51fd6e371
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/pty-session.c

index 8352f8c677837c21ae4aed7e240c8e726cca404c..6f038e1c58c3d15add83703b2ad9e8a8b5ae6263 100644 (file)
@@ -18,6 +18,7 @@
 #include <paths.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <inttypes.h>
 
 #include "c.h"
 #include "all-io.h"
@@ -129,7 +130,8 @@ void ul_pty_set_mainloop_time(struct ul_pty *pty, struct timeval *tv)
        } else {
                pty->next_callback_time.tv_sec = tv->tv_sec;
                pty->next_callback_time.tv_usec = tv->tv_usec;
-               DBG(IO, ul_debugobj(pty, "mainloop time: %ld.%06ld", tv->tv_sec, tv->tv_usec));
+               DBG(IO, ul_debugobj(pty, "mainloop time: %"PRId64".%06"PRId64,
+                               (int64_t) tv->tv_sec, (int64_t) tv->tv_usec));
        }
 }