strace/linux/xtensa/get_error.c
Dmitry V. Levin 0c8c5c9f4e cleanup: make get_error.c files more readable
Make get_error.c files more self-sustained.  While they are still being
included by syscall.c, the latter no longer defines get_error function.

* linux/aarch64/get_error.c: Include "arm/get_error.c" with get_error
temporarily defined to arm_get_error.
(get_error): Define.
* linux/alpha/get_error.c (get_error): Define.
* linux/arc/get_error.c: Likewise.
* linux/arm/get_error.c: Likewise.
* linux/avr32/get_error.c: Likewise.
* linux/bfin/get_error.c: Likewise.
* linux/crisv10/get_error.c: Likewise.
* linux/hppa/get_error.c: Likewise.
* linux/i386/get_error.c: Likewise.
* linux/ia64/get_error.c: Likewise.
* linux/m68k/get_error.c: Likewise.
* linux/metag/get_error.c: Likewise.
* linux/microblaze/get_error.c: Likewise.
* linux/mips/get_error.c: Likewise.
* linux/nios2/get_error.c: Likewise.
* linux/or1k/get_error.c: Likewise.
* linux/powerpc/get_error.c: Likewise.
* linux/s390/get_error.c: Likewise.
* linux/sh/get_error.c: Likewise.
* linux/sh64/get_error.c: Likewise.
* linux/sparc/get_error.c: Likewise.
* linux/sparc64/get_error.c: Likewise.
* linux/tile/get_error.c: Likewise.
* linux/x86_64/get_error.c: Likewise.
* linux/xtensa/get_error.c: Likewise.
* syscall.c: Include "get_error.c" in file scope.
(get_error): Remove.  Move arch independent code ...
(get_syscall_result): ... here.  Update get_error invocation.

Requested-by: Denys Vlasenko <dvlasenk@redhat.com>
2015-11-29 00:06:45 +00:00

11 lines
207 B
C

static void
get_error(struct tcb *tcp, const bool check_errno)
{
if (check_errno && is_negated_errno(xtensa_a2)) {
tcp->u_rval = -1;
tcp->u_error = -xtensa_a2;
} else {
tcp->u_rval = xtensa_a2;
}
}