summaryrefslogtreecommitdiff
path: root/mq.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2015-09-18 01:54:59 +0000
committerDmitry V. Levin <ldv@altlinux.org>2015-09-19 04:04:49 +0300
commit3858b93ad9d2d3990f6724585e14675e663a1b5d (patch)
treea11483205d589c60c724226b4b8b0e7f72acce0d /mq.c
parent593602ce5a8812775ac1d9cadab8f61fa68e63f3 (diff)
downloadstrace-3858b93ad9d2d3990f6724585e14675e663a1b5d.tar.gz
Add helper functions to clear/restore syserror
* defs.h (temporarily_clear_syserror, restore_cleared_syserror): New prototypes. * syscall.c (saved_u_error): New variable. (temporarily_clear_syserror, restore_cleared_syserror): New functions. * aio.c (sys_io_getevents): Use temporarily_clear_syserror and restore_cleared_syserror. * mq.c (sys_mq_timedreceive): Likewise. * signal.c (sys_rt_sigtimedwait): Likewise.
Diffstat (limited to 'mq.c')
-rw-r--r--mq.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mq.c b/mq.c
index ca0cfdaf2..a0af21158 100644
--- a/mq.c
+++ b/mq.c
@@ -59,7 +59,14 @@ SYS_FUNC(mq_timedreceive)
else {
printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
tprintf(", %lu, %ld, ", tcp->u_arg[2], tcp->u_arg[3]);
+ /*
+ * Since the timeout parameter is read by the kernel
+ * on entering syscall, it has to be decoded the same way
+ * whether the syscall has failed or not.
+ */
+ temporarily_clear_syserror(tcp);
printtv(tcp, tcp->u_arg[4]);
+ restore_cleared_syserror(tcp);
}
return 0;
}