From patchwork Sun May 3 18:27:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 1282063 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49FZGF2gJ5z9sPF for ; Mon, 4 May 2020 04:27:17 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=m2Qzzb0/; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49FZGF1mTfzDqgP for ; Mon, 4 May 2020 04:27:17 +1000 (AEST) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=m2Qzzb0/; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49FZG74nVJzDqdg for ; Mon, 4 May 2020 04:27:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=kZQARMrXRmOiS+kvWjNpHFrdA6ysH/gcLlvckpnVW/g=; b=m2Qzzb0/Qw4fnbZCPXFXueAId2 PUuNYPB9wQBv+s6cRDVja9liSbMSrVAOFtMiSKQSmz/u9p0XnQ/xyvS6K3JaYlqlVHcqj4Fs4UP9P fX4SrEr758VFhT7FbDW905at+3uE4HNbSYjSRQPUFvoq0Av0jaPuicNhmMHKAjwQbXx0QWUnK1ljm 3fG+qjZAttGSRJT3UL+IZIaFhgX1qwAp2hIAPu9nzVfzzB9hu6KOpFlqtcy2sdaz2ouLclI/1hyQd AKL2GjErPNOBNCt1OZdEcT5ARR+rwtfet578DAkX73Xc+cWXtziC5uejDSGHPtRoJQLfhu8x9bfX1 LwDHq+lw==; Received: from [2602:306:37b0:7840:74d2:f789:74e8:9f56] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jVJKX-0004EC-LM; Sun, 03 May 2020 18:27:09 +0000 Subject: [PATCH v2 4/5] pb-discover: Fix signal handler To: Jeremy Kerr References: <461d16d14b23185945ba560cf72586afb54db346.camel@ozlabs.org> From: Geoff Levand Message-ID: <932ad756-2835-4c10-79c1-e8a6f7b1888f@infradead.org> Date: Sun, 3 May 2020 11:27:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <461d16d14b23185945ba560cf72586afb54db346.camel@ozlabs.org> Content-Language: en-US X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: petitboot@lists.ozlabs.org Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Variables shared between signal handlers and the main program need to be of type 'volatile sig_atomic_t'. Signed-off-by: Geoff Levand --- Here's a V2 that has the re-enable call removed. discover/pb-discover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discover/pb-discover.c b/discover/pb-discover.c index e2b36dd..6f43cc3 100644 --- a/discover/pb-discover.c +++ b/discover/pb-discover.c @@ -113,7 +113,7 @@ static int opts_parse(struct opts *opts, int argc, char *argv[]) return optind != argc; } -static int running; +static volatile sig_atomic_t running; static void sigint_handler(int __attribute__((unused)) signum) {