From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rUs-0002Fx-Rj for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4rUn-00046X-EQ for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:21 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rUn-00046D-7d for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:17 -0400 Received: by mail-wm0-x244.google.com with SMTP id f75so9713910wmf.2 for ; Mon, 23 May 2016 08:10:17 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 23 May 2016 17:09:49 +0200 Message-Id: <1464016199-43768-15-git-send-email-pbonzini@redhat.com> In-Reply-To: <1464016199-43768-1-git-send-email-pbonzini@redhat.com> References: <1464016199-43768-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 14/24] cpus.c: Use pthread_sigmask() rather than sigprocmask() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell From: Peter Maydell On Linux, sigprocmask() and pthread_sigmask() are in practice the same thing (they only set the signal mask for the calling thread), but the documentation states that the behaviour of sigprocmask() in a multithreaded process is undefined. Use pthread_sigmask() instead (which is what we do in almost all places in QEMU that alter the signal mask already). Signed-off-by: Peter Maydell Message-Id: <1463420039-29761-1-git-send-email-peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini --- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index eb34b4f..f8366c6 100644 --- a/cpus.c +++ b/cpus.c @@ -780,7 +780,7 @@ static void sigbus_reraise(void) raise(SIGBUS); sigemptyset(&set); sigaddset(&set, SIGBUS); - sigprocmask(SIG_UNBLOCK, &set, NULL); + pthread_sigmask(SIG_UNBLOCK, &set, NULL); } perror("Failed to re-raise SIGBUS!\n"); abort(); -- 1.8.3.1