diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2015-09-18 01:54:59 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2015-09-19 04:04:49 +0300 |
commit | 3858b93ad9d2d3990f6724585e14675e663a1b5d (patch) | |
tree | a11483205d589c60c724226b4b8b0e7f72acce0d /mq.c | |
parent | 593602ce5a8812775ac1d9cadab8f61fa68e63f3 (diff) | |
download | strace-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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; } |