aboutsummaryrefslogtreecommitdiff
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorTimothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>2015-08-31 00:26:21 +0100
committerRiku Voipio <riku.voipio@linaro.org>2015-09-28 16:40:12 +0300
commit93b4eff80af9822e4b726dcf21ee61538e088695 (patch)
tree3781140f56d8f46b4048d78b7045aff51341bca7 /linux-user/syscall.c
parentee1045877a7e226945c7cec2bda80039bd2d0c8e (diff)
linux-user: Return target error number in do_fork()
Whilst calls to do_fork() are wrapped in get_errno() this does not translate return values. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 75ac32c05d..c25ffd8878 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) {