qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 14/16 v1] linux-user: main: Use negative qemu errno


From: Chen Gang
Subject: [Qemu-devel] [PATCH 14/16 v1] linux-user: main: Use negative qemu errno for syscall return errno
Date: Fri, 21 Aug 2015 05:47:08 +0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

The qemu errno is negative of normal errno, so revert it before return
from syscall, or the related user mode checking will fail, e.g. cp/mv
will call stat64 and check errno ENOENT (not -ENOENT).

Signed-of-by Chen Gang <address@hidden>
---
 linux-user/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/main.c b/linux-user/main.c
index 253aade..f0bda09 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3654,7 +3654,7 @@ void cpu_loop(CPUTLGState *env)
                                                 env->regs[4], env->regs[5],
                                                 env->regs[6], env->regs[7]);
             env->regs[TILEGX_R_ERR] = TILEGX_IS_ERRNO(env->regs[TILEGX_R_RE])
-                                                      ? env->regs[TILEGX_R_RE]
+                                                      ? - 
env->regs[TILEGX_R_RE]
                                                       : 0;
             break;
         case TILEGX_EXCP_OPCODE_EXCH:
-- 
1.9.3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]