]> granicus.if.org Git - strace/commitdiff
alpha, ia64, mips, nios2, powerpc, sparc: always check for syscall error
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 27 Dec 2015 00:18:51 +0000 (00:18 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 27 Dec 2015 01:02:53 +0000 (01:02 +0000)
On architectures that use dedicated registers to report syscall errors,
check for syscall error condition regardless of SYSCALL_NEVER_FAILS flag
in the syscall entry.  On architectures that use negated errno
semantics, there is no way to distinguish a syscall error from a valid
return code that looks like a syscall error, and the check for
SYSCALL_NEVER_FAILS flag remains the only way to tell one case
from another.

* linux/alpha/get_error.c (get_error): Ignore check_errno.
* linux/ia64/get_error.c: Likewise.
* linux/mips/get_error.c: Likewise.
* linux/nios2/get_error.c: Likewise.
* linux/powerpc/get_error.c: Likewise.
* linux/sparc/get_error.c: Likewise.
* linux/sparc64/get_error.c: Likewise.

linux/alpha/get_error.c
linux/ia64/get_error.c
linux/mips/get_error.c
linux/nios2/get_error.c
linux/powerpc/get_error.c
linux/sparc/get_error.c
linux/sparc64/get_error.c

index ddf3dae9c5175f8634ebf4290bc772b0dc94eddb..d4928d4be0da043ccaf44da411586fae2a0a93a3 100644 (file)
@@ -1,7 +1,7 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-       if (check_errno && alpha_a3) {
+       if (alpha_a3) {
                tcp->u_rval = -1;
                tcp->u_error = alpha_r0;
        } else {
index 09dfdef6866e68381074045e23ea0697f5a6675a..52daa7f44d448ee66607b5fe45d473a641b7184d 100644 (file)
@@ -10,7 +10,7 @@ get_error(struct tcb *tcp, const bool check_errno)
                        tcp->u_rval = err;
                }
        } else {
-               if (check_errno && ia64_regs.gr[10]) {
+               if (ia64_regs.gr[10]) {
                        tcp->u_rval = -1;
                        tcp->u_error = ia64_regs.gr[8];
                } else {
index e58055e132d02e127c9b25509d23eabd39626e74..42a282b45266176197610bb55eb9a7f218340f88 100644 (file)
@@ -1,7 +1,7 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-       if (check_errno && mips_REG_A3) {
+       if (mips_REG_A3) {
                tcp->u_rval = -1;
                tcp->u_error = mips_REG_V0;
        } else {
index 52c05ad916a26902bf05a4c5459ca241aff4a1eb..1c91c0acfd8d9e482a77e7de54e573efe62518d2 100644 (file)
@@ -8,7 +8,7 @@ get_error(struct tcb *tcp, const bool check_errno)
         * the system call success, r7=1 indicates an error.  The positive
         * errno value written in r2.
         */
-       if (check_errno && nios2_regs.regs[7]) {
+       if (nios2_regs.regs[7]) {
                tcp->u_rval = -1;
                tcp->u_error = nios2_regs.regs[2];
        } else {
index 41506fb72419047c42d267a83b02cedc6b49bfb4..8f10612d4a901f1160d8e3e141417fc8d263dc61 100644 (file)
@@ -1,7 +1,7 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-       if (check_errno && (ppc_regs.ccr & 0x10000000)) {
+       if (ppc_regs.ccr & 0x10000000) {
                tcp->u_rval = -1;
                tcp->u_error = ppc_regs.gpr[3];
        } else {
index fa57ed091a93661a3efb87698eb0dfcb714aa2e2..1b960ace73ac31e96d49e372350cd5fdb3b6a10f 100644 (file)
@@ -1,7 +1,7 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-       if (check_errno && sparc_regs.psr & PSR_C) {
+       if (sparc_regs.psr & PSR_C) {
                tcp->u_rval = -1;
                tcp->u_error = sparc_regs.u_regs[U_REG_O0];
        } else {
index bacd04fbdc8fe90e6711c7176d79ea9594e80734..8f8978b6b3a4d3903f27f4bfab99d40d248f2058 100644 (file)
@@ -1,7 +1,7 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-       if (check_errno && sparc_regs.tstate & 0x1100000000UL) {
+       if (sparc_regs.tstate & 0x1100000000UL) {
                tcp->u_rval = -1;
                tcp->u_error = sparc_regs.u_regs[U_REG_O0];
        } else {