From: Timothy E Baldwin Date: Sun, 30 Aug 2015 23:26:21 +0000 (+0100) Subject: linux-user: Return target error number in do_fork() X-Git-Tag: TizenStudio_2.0_p2.3.2~120^2~1^2~153^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=93b4eff80af9822e4b726dcf21ee61538e088695;p=sdk%2Femulator%2Fqemu.git 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 Signed-off-by: Timothy Edward Baldwin Signed-off-by: Riku Voipio --- 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) {