]> granicus.if.org Git - strace/blobdiff - mq.c
tests: rewrite sigreturn syscall decoding check from match_grep to match_diff
[strace] / mq.c
diff --git a/mq.c b/mq.c
index cd4334a64ee5089f8ef055ed263081fec9d75aa1..ed167764c852d8a6600cbe0c6d91f20bf1660875 100644 (file)
--- a/mq.c
+++ b/mq.c
@@ -40,7 +40,7 @@ SYS_FUNC(mq_open)
                tprints(", ");
                print_numeric_umode_t(tcp->u_arg[2]);
                tprints(", ");
-               printmqattr(tcp, tcp->u_arg[3]);
+               printmqattr(tcp, tcp->u_arg[3], false);
        }
        return RVAL_DECODED;
 }
@@ -48,8 +48,9 @@ SYS_FUNC(mq_open)
 SYS_FUNC(mq_timedsend)
 {
        tprintf("%d, ", (int) tcp->u_arg[0]);
-       printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
-       tprintf(", %lu, %ld, ", tcp->u_arg[2], tcp->u_arg[3]);
+       printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+       tprintf(", %" PRI_klu ", %u, ", tcp->u_arg[2],
+               (unsigned int) tcp->u_arg[3]);
        print_timespec(tcp, tcp->u_arg[4]);
        return RVAL_DECODED;
 }
@@ -59,8 +60,13 @@ SYS_FUNC(mq_timedreceive)
        if (entering(tcp)) {
                tprintf("%d, ", (int) tcp->u_arg[0]);
        } else {
-               printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
-               tprintf(", %lu, %ld, ", tcp->u_arg[2], tcp->u_arg[3]);
+               if (syserror(tcp))
+                       printaddr(tcp->u_arg[1]);
+               else
+                       printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
+               tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
+               printnum_int(tcp, tcp->u_arg[3], "%u");
+               tprints(", ");
                /*
                 * Since the timeout parameter is read by the kernel
                 * on entering syscall, it has to be decoded the same way
@@ -84,10 +90,10 @@ SYS_FUNC(mq_getsetattr)
 {
        if (entering(tcp)) {
                tprintf("%d, ", (int) tcp->u_arg[0]);
-               printmqattr(tcp, tcp->u_arg[1]);
+               printmqattr(tcp, tcp->u_arg[1], true);
                tprints(", ");
        } else {
-               printmqattr(tcp, tcp->u_arg[2]);
+               printmqattr(tcp, tcp->u_arg[2], true);
        }
        return 0;
 }