]> granicus.if.org Git - strace/blobdiff - mq.c
Update NEWS
[strace] / mq.c
diff --git a/mq.c b/mq.c
index cd4334a64ee5089f8ef055ed263081fec9d75aa1..1970f930d699e79399733e6a8ac43882878c3b81 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;
 }
@@ -49,7 +49,8 @@ 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]);
+       tprintf(", %llu, %u, ", getarg_ull(tcp, 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) && (tcp->u_rval >= 0))
+                       printstr(tcp, tcp->u_arg[1], tcp->u_rval);
+               else
+                       printaddr(tcp->u_arg[1]);
+               tprintf(", %llu, ", getarg_ull(tcp, 2));
+               printnum_int(tcp, tcp->u_arg[3], "%u");
+               tprintf(", ");
                /*
                 * 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;
 }