diff options
author | Eugene Syromyatnikov <evgsyr@gmail.com> | 2016-10-27 10:00:46 +0300 |
---|---|---|
committer | Eugene Syromyatnikov <evgsyr@gmail.com> | 2016-10-29 02:54:02 +0300 |
commit | 3e22464ec72f96457c88a2489cd1bfcd2c174106 (patch) | |
tree | 1f58b98490d0318325335c7efaf0709b2230c0c4 /mq.c | |
parent | 0302a3186e4ab7902a91122f43bf419cf99b473a (diff) | |
download | strace-3e22464ec72f96457c88a2489cd1bfcd2c174106.tar.gz |
mq: Properly print mq_flags field
mq_flags field of struct mq_attr can contain only O_NONBLOCK flag (other
flags are treated as invalid by mq_getsetattr). Moreover, this field is
ignored by mq_open at all (O_NONBLOCK is set via oflag, not via attr
attribute).
* xlat/mq_attr_flags.in: New file.
* print_mq_attr.c: Include xlat/mq_attr_flags.h.
(printmqattr): New parameter, bool decode_flags; cast members of struct
mq_attr to long long type; use mq_attr_flags xlat for printing mq_flags;
print mq_flags as flags only in case decode_flags parameter is set
to true.
* mq.c (SYS_FUNC(mq_open)): Specify value of false for decode_flags
parameter of printmqattr call.
(SYS_FUNC(mq_getsetattr)): Specify value of true for decode_flags
parameter of printmqattr call.
* tests/mq.expected: Update expected output.
Diffstat (limited to 'mq.c')
-rw-r--r-- | mq.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } @@ -84,10 +84,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; } |