]> granicus.if.org Git - strace/commitdiff
mq.c: remove repeated code
authorElvira Khabirova <lineprinter0@gmail.com>
Thu, 20 Aug 2015 18:14:29 +0000 (21:14 +0300)
committerElvira Khabirova <lineprinter0@gmail.com>
Thu, 20 Aug 2015 19:29:15 +0000 (22:29 +0300)
* mq.c (sys_mq_open): Use printmqattr instead of implementing it again.
[HAVE_MQUEUE_H]: Remove.

mq.c

diff --git a/mq.c b/mq.c
index a6d7512d72890b3632869c25d6b707590c6a6455..464045ff75bf091cb24e24cad42a16d502ae67d0 100644 (file)
--- a/mq.c
+++ b/mq.c
 #include "defs.h"
 #include <fcntl.h>
 
-#ifdef HAVE_MQUEUE_H
-# include <mqueue.h>
-#endif
-
 extern void printmqattr(struct tcb *tcp, const long addr);
 
 SYS_FUNC(mq_open)
@@ -44,16 +40,7 @@ SYS_FUNC(mq_open)
        if (tcp->u_arg[1] & O_CREAT) {
                /* mode */
                tprintf(", %#lo, ", tcp->u_arg[2]);
-# ifndef HAVE_MQUEUE_H
-               printaddr(tcp->u_arg[3]);
-# else
-               struct mq_attr attr;
-
-               if (!umove_or_printaddr(tcp, tcp->u_arg[3], &attr))
-                       tprintf("{mq_maxmsg=%ld, mq_msgsize=%ld}",
-                               (long) attr.mq_maxmsg,
-                               (long) attr.mq_msgsize);
-# endif
+               printmqattr(tcp, tcp->u_arg[3]);
        }
        return RVAL_DECODED;
 }