]> git.proxmox.com Git - qemu.git/commit
linux-user: fix wait* syscall status returns
authorAlexander Graf <agraf@suse.de>
Wed, 23 Nov 2011 23:44:43 +0000 (00:44 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Thu, 2 Feb 2012 15:51:20 +0000 (17:51 +0200)
commit5379557b8d5acb140c17e00441fda45eae627fed
tree9fff1135d092844973fd391bb8696d6c520499de
parent2a7e12455c1d388e41f4c8d2231fb48a968792cd
linux-user: fix wait* syscall status returns

When calling wait4 or waitpid with a status pointer and WNOHANG, the
syscall can potentially not modify the status pointer input. Now if we
have guest code like:

  int status = 0;
  waitpid(pid, &status, WNOHANG);
  if (status)
     <breakage>

then we have to make sure that in case status did not change we actually
return the guest's initialized status variable instead of our own uninitialized.
We fail to do so today, as we proxy everything through an uninitialized status
variable which for me ended up always containing the last error code.

This patch fixes some test cases when building yast2-core in OBS for ARM.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/syscall.c