From patchwork Sat Sep 5 23:57:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Baldwin X-Patchwork-Id: 514883 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 92C59140497 for ; Sun, 6 Sep 2015 10:11:08 +1000 (AEST) Received: from localhost ([::1]:43663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYNY2-0000iJ-S9 for incoming@patchwork.ozlabs.org; Sat, 05 Sep 2015 20:11:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYNLk-00036x-7M for qemu-devel@nongnu.org; Sat, 05 Sep 2015 19:58:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYNLh-0005wU-5c for qemu-devel@nongnu.org; Sat, 05 Sep 2015 19:58:24 -0400 Received: from avasout06.plus.net ([212.159.14.18]:39202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYNLg-0005si-Pj for qemu-devel@nongnu.org; Sat, 05 Sep 2015 19:58:21 -0400 Received: from bfg ([87.114.133.92]) by avasout06 with smtp id DbyK1r00C1zmLPr01byLfE; Sun, 06 Sep 2015 00:58:20 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=E4sw3vpl c=1 sm=1 tr=0 a=wMIFfKY+zwUDgD4aAwecrg==:117 a=wMIFfKY+zwUDgD4aAwecrg==:17 a=0Bzu9jTXAAAA:8 a=FJhpQO9QAAAA:8 a=h_6DSLV0AAAA:8 a=ff-B7xzCdYMA:10 a=2B0aneRPd7qS9dEfMsQA:9 a=XSEN9IhICnDIJkqB:21 a=1442oK8dDqRQJGdi:21 Received: from tim by bfg with local (Exim 4.84) (envelope-from ) id 1ZYNLe-00005E-I2; Sun, 06 Sep 2015 00:58:18 +0100 From: Timothy E Baldwin To: qemu-devel@nongnu.org Date: Sun, 6 Sep 2015 00:57:21 +0100 Message-Id: <1441497448-32489-28-git-send-email-T.E.Baldwin99@members.leeds.ac.uk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441497448-32489-1-git-send-email-T.E.Baldwin99@members.leeds.ac.uk> References: <1441497448-32489-1-git-send-email-T.E.Baldwin99@members.leeds.ac.uk> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 212.159.14.18 Cc: riku.voipio@iki.fi, Timothy E Baldwin Subject: [Qemu-devel] [PATCH 27/34] linux-user: pause() should not pause if signal pending X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Timothy Edward Baldwin Reviewed-by: Peter Maydell --- linux-user/syscall.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index da6d140..f89b730 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6106,7 +6106,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_pause /* not on alpha */ case TARGET_NR_pause: - ret = get_errno(pause()); + if (!block_signals()) { + sigsuspend(&((TaskState *)cpu->opaque)->signal_mask); + } + ret = -TARGET_EINTR; break; #endif #ifdef TARGET_NR_utime