]> granicus.if.org Git - strace/commitdiff
v4l2: use uintmax_t for times
authorMike Frysinger <vapier@gentoo.org>
Thu, 26 Feb 2015 05:57:18 +0000 (00:57 -0500)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 26 Feb 2015 20:00:03 +0000 (20:00 +0000)
There is no guarantee that the backing value for the various time fields
are ints or longs which makes printfs annoying.  Lets cast them to the
uintmax_t type so we can use the j flag and not worry about truncation.

* v4l2.c (v4l2_ioctl): Use j and uintmax_t when printing tv_sec/tv_usec.

v4l2.c

diff --git a/v4l2.c b/v4l2.c
index 88b0532f9f8042dbd70aee244049e994ff1b4586..ae1ebb8adf2046151815880f8ba586d8585c51dc 100644 (file)
--- a/v4l2.c
+++ b/v4l2.c
@@ -633,9 +633,9 @@ v4l2_ioctl(struct tcb *tcp, const unsigned int code, long arg)
                                        b.length, b.bytesused);
                                printflags(v4l2_buf_flags, b.flags, "V4L2_BUF_FLAG_???");
                                if (code == VIDIOC_DQBUF)
-                                       tprintf(", timestamp = {%lu.%06lu}",
-                                               b.timestamp.tv_sec,
-                                               b.timestamp.tv_usec);
+                                       tprintf(", timestamp = {%ju.%06ju}",
+                                               (uintmax_t)b.timestamp.tv_sec,
+                                               (uintmax_t)b.timestamp.tv_usec);
                                tprints(", ...");
                        }
                        tprints("}");