mq: print msg payload only in case of successful mq_timedreceive call
Also, use u_rval for determining message size. * mq.c (SYS_FUNC(mq_timedreceive)): Check for syserror and non-negative u_rval before calling printstr on msg_ptr argument, or use printaddr otherwise; provide u_rval as string size.
This commit is contained in:
parent
19bd947891
commit
26690859f6
5
mq.c
5
mq.c
@ -60,7 +60,10 @@ SYS_FUNC(mq_timedreceive)
|
|||||||
if (entering(tcp)) {
|
if (entering(tcp)) {
|
||||||
tprintf("%d, ", (int) tcp->u_arg[0]);
|
tprintf("%d, ", (int) tcp->u_arg[0]);
|
||||||
} else {
|
} else {
|
||||||
printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
if (!syserror(tcp) && (tcp->u_rval >= 0))
|
||||||
|
printstr(tcp, tcp->u_arg[1], tcp->u_rval);
|
||||||
|
else
|
||||||
|
printaddr(tcp->u_arg[1]);
|
||||||
tprintf(", %llu, %ld, ", getarg_ull(tcp, 2), tcp->u_arg[3]);
|
tprintf(", %llu, %ld, ", getarg_ull(tcp, 2), tcp->u_arg[3]);
|
||||||
/*
|
/*
|
||||||
* Since the timeout parameter is read by the kernel
|
* Since the timeout parameter is read by the kernel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user