qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 09/13] linux-user: Return target error number in do_f


From: riku . voipio
Subject: [Qemu-devel] [PULL 09/13] linux-user: Return target error number in do_fork()
Date: Fri, 2 Oct 2015 16:01:01 +0300

From: Timothy E Baldwin <address@hidden>

Whilst calls to do_fork() are wrapped in get_errno() this does not
translate return values.

Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Timothy Edward Baldwin <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
 linux-user/syscall.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 75ac32c..c25ffd8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4626,8 +4626,9 @@ static int do_fork(CPUArchState *env, unsigned int flags, 
abi_ulong newsp,
         pthread_mutex_unlock(&clone_lock);
     } else {
         /* if no CLONE_VM, we consider it is a fork */
-        if ((flags & ~(CSIGNAL | CLONE_NPTL_FLAGS2)) != 0)
-            return -EINVAL;
+        if ((flags & ~(CSIGNAL | CLONE_NPTL_FLAGS2)) != 0) {
+            return -TARGET_EINVAL;
+        }
         fork_start();
         ret = fork();
         if (ret == 0) {
-- 
2.5.3




reply via email to

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