Files
strace/linux/sh/get_error.c
Dmitry V. Levin 51d89ef0a0 Refactor get_syscall_args() and get_error()
* linux/*/get_error.c: Rename all arch-specific implementations
of get_error() to arch_get_error().
* linux/*/get_syscall_args.c: Rename all arch-specific implementations
of get_syscall_args() to arch_get_syscall_args().
* syscall.c (get_syscall_args, get_error): New functions.
(tamper_with_syscall_exiting, get_syscall_result): Do not clear
tcp->u_error before get_error() invocation as the latter does it now.
2018-12-05 16:10:05 +00:00

13 lines
228 B
C

#include "negated_errno.h"
static void
arch_get_error(struct tcb *tcp, const bool check_errno)
{
if (check_errno && is_negated_errno(sh_r0)) {
tcp->u_rval = -1;
tcp->u_error = -sh_r0;
} else {
tcp->u_rval = sh_r0;
}
}