mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-17 18:48:36 +00:00
linux-user: Restart fork() if signals pending
If there is a signal pending during fork() the signal handler will erroneously be called in both the parent and child, so handle any pending signals first. Signed-off-by: Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk> Message-id: 1441497448-32489-20-git-send-email-T.E.Baldwin99@members.leeds.ac.uk Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
This commit is contained in:
parent
bef653d92e
commit
7d92d34ee4
@ -5437,6 +5437,11 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,
|
||||
if ((flags & ~(CSIGNAL | CLONE_NPTL_FLAGS2)) != 0) {
|
||||
return -TARGET_EINVAL;
|
||||
}
|
||||
|
||||
if (block_signals()) {
|
||||
return -TARGET_ERESTARTSYS;
|
||||
}
|
||||
|
||||
fork_start();
|
||||
ret = fork();
|
||||
if (ret == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user