]> granicus.if.org Git - strace/blobdiff - v4l2.c
signal: fix omission of field names in sigaction printers
[strace] / v4l2.c
diff --git a/v4l2.c b/v4l2.c
index ab9a69c6df00fecf438b30d6d21306c582a2f84b..3aee199c0936eb17778a8e28a2ae69eba51bb941 100644 (file)
--- a/v4l2.c
+++ b/v4l2.c
@@ -359,17 +359,17 @@ print_v4l2_buffer(struct tcb *tcp, const unsigned int code, const long arg)
                        if (b.memory == V4L2_MEMORY_MMAP) {
                                tprintf(", m.offset=%#x", b.m.offset);
                        } else if (b.memory == V4L2_MEMORY_USERPTR) {
-                               tprintf(", m.userptr=%#lx",
-                                       (unsigned long) b.m.userptr);
+                               tprints(", m.userptr=");
+                               printaddr((unsigned long) b.m.userptr);
                        }
 
                        tprintf(", length=%u, bytesused=%u, flags=",
                                b.length, b.bytesused);
                        printflags(v4l2_buf_flags, b.flags, "V4L2_BUF_FLAG_???");
-                       if (code == VIDIOC_DQBUF)
-                               tprintf(", timestamp = {%ju.%06ju}",
-                                       (uintmax_t)b.timestamp.tv_sec,
-                                       (uintmax_t)b.timestamp.tv_usec);
+                       if (code == VIDIOC_DQBUF) {
+                               tprints(", timestamp = ");
+                               MPERS_FUNC_NAME(print_struct_timeval)(&b.timestamp);
+                       }
                        tprints(", ...");
                }
                tprints("}");
@@ -384,8 +384,10 @@ print_v4l2_framebuffer(struct tcb *tcp, const long arg)
 
        tprints(", ");
        if (!umove_or_printaddr(tcp, arg, &b)) {
-               tprintf("{capability=%#x, flags=%#x, base=%#lx}",
-                       b.capability, b.flags, (unsigned long) b.base);
+               tprintf("{capability=%#x, flags=%#x, base=",
+                       b.capability, b.flags);
+               printaddr((unsigned long) b.base);
+               tprints("}");
        }
 
        return RVAL_DECODED | 1;
@@ -569,14 +571,15 @@ print_v4l2_queryctrl(struct tcb *tcp, const long arg)
                        tprints("}");
                        return 1;
                }
-               if (tcp->auxstr)
+               if (get_tcb_priv_ulong(tcp))
                        tprints(" => ");
        }
 
-       if (entering(tcp) || tcp->auxstr) {
+       if (entering(tcp) || get_tcb_priv_ulong(tcp)) {
 #ifdef V4L2_CTRL_FLAG_NEXT_CTRL
-               tcp->auxstr = (c.id & V4L2_CTRL_FLAG_NEXT_CTRL) ? "" : NULL;
-               if (tcp->auxstr) {
+               const unsigned long next = c.id & V4L2_CTRL_FLAG_NEXT_CTRL;
+               set_tcb_priv_ulong(tcp, next);
+               if (next) {
                        tprints("V4L2_CTRL_FLAG_NEXT_CTRL|");
                        c.id &= ~V4L2_CTRL_FLAG_NEXT_CTRL;
                }
@@ -672,21 +675,6 @@ print_v4l2_ext_control(struct tcb *tcp, void *elem_buf, size_t elem_size, void *
 
 #include "xlat/v4l2_control_classes.h"
 
-static int
-umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const long addr,
-                                   const unsigned int len, void *our_addr)
-{
-       if (!addr) {
-               tprints("NULL");
-               return -1;
-       }
-       if (umoven(tcp, addr, len, our_addr) < 0) {
-               tprintf("%#lx", addr);
-               return -1;
-       }
-       return 0;
-}
-
 static int
 print_v4l2_ext_controls(struct tcb *tcp, const long arg, const bool is_get)
 {
@@ -846,7 +834,8 @@ print_v4l2_create_buffers(struct tcb *tcp, const long arg)
 }
 #endif /* VIDIOC_CREATE_BUFS */
 
-MPERS_PRINTER_DECL(int, v4l2_ioctl)(struct tcb *tcp, const unsigned int code, const long arg)
+MPERS_PRINTER_DECL(int, v4l2_ioctl,
+                  struct tcb *tcp, const unsigned int code, const long arg)
 {
        if (!verbose(tcp))
                return RVAL_DECODED;