Commit 93b4eff8 authored by Timothy E Baldwin's avatar Timothy E Baldwin Committed by Riku Voipio
Browse files

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: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarTimothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
Signed-off-by: default avatarRiku Voipio <riku.voipio@linaro.org>
parent ee104587
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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) {