Message ID | 20181124092253.6225-1-mhei@heimpold.de |
---|---|
State | Accepted |
Delegated to: | John Crispin |
Headers | show
Return-Path: <openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=heimpold.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sVmIQI3I"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=heimpold.de header.i=@heimpold.de header.b="OUbSp4Rl"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43275T0xBNz9ryk for <incoming@patchwork.ozlabs.org>; Sat, 24 Nov 2018 20:23:25 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fhU0meP3vAGm7xn+4I7q1ya83rzizZQuwjom+2iu3/Y=; b=sVmIQI3I3auywN Waf01cbkwS+LNlyI06M5StGuatojZiaUT8kNMNmCaVUp+dRDEg6Ha9pvRuEkgl8URTcjhSOt7oD8A 30PW5FE6V+/K18ocbIgWEYHdSGdFVPDaDTEvS1+aky+Fexwp85GdgiT70iupc/oBXzSKunm8aLyxl T/QiFhQuxKc9IjfgDqySDI+tZWj5EHVJuxYzlcyQA8uCe0qcjwPCBdIX1LSgTk5iZ13yuiaHs2G3S z4IKRO61SZXQJxZdtwZVuYXcz8Fr7TE8zKZksDa2FGKynnAcaoO+e1ZRlox+hUWScYELDOIYuH/j7 WGxy7jkSsRe/vwWSBfDw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gQU9l-0002D2-KA; Sat, 24 Nov 2018 09:23:17 +0000 Received: from mo6-p01-ob.smtp.rzone.de ([2a01:238:20a:202:5301::5]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gQU9c-00021E-CL for openwrt-devel@lists.openwrt.org; Sat, 24 Nov 2018 09:23:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1543051375; s=strato-dkim-0002; d=heimpold.de; h=Message-Id:Date:Subject:Cc:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=0uZHObjbSc86jOqPa+6lkO0xlvmJzOW22gwAE1zTfd0=; b=OUbSp4Rl9tmOxNMYlXUw/8U7ImyVlhNA13A3pn4E4jC6iEF/+62o1H7Vq8mdEIFXCx WBSUeIemu/En07ZPkQtqbIJJeGjV9fzualP30+O471q6CcBhQRbDrEPWQTLvGoEbDVxT yj1qCy3iC9e8pEGEPuSpQYGMnRAoPj9Y3r17d4uLWs5waMVdYK0CQwEaySlzq9rv4vhY m+OcZSkA5WErDyutuwX/rGFxtlXy8tfVX1FVzTvXF+vJ2TND1eZSLMCr9sjXIwbzzAP9 vFAmQQjNmH/PaKYekTWSgvwI/SI88B+G4PQVi0dDfZvC6fqV2amuXdrXo5g97NjnvQb9 N/og== X-RZG-AUTH: ":O2kGeEG7b/pS1EW8QnKjhhg/vO4pzqdNytq77N6ZPUGwIpLOmsCM+BB/Juqg4gUnrq30T6zUj9/3iw==" X-RZG-CLASS-ID: mo00 Received: from tonne.mhei.heimpold.itr by smtp.strato.de (RZmta 44.4 DYNA|AUTH) with ESMTPSA id z0a99fuAO9MtBh1 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sat, 24 Nov 2018 10:22:55 +0100 (CET) Received: from kerker.mhei.heimpold.itr (kerker.mhei.heimpold.itr [192.168.8.1]) by tonne.mhei.heimpold.itr (Postfix) with ESMTP id 168AE1A061B; Sat, 24 Nov 2018 10:22:54 +0100 (CET) From: Michael Heimpold <mhei@heimpold.de> To: openwrt-devel@lists.openwrt.org Date: Sat, 24 Nov 2018 10:22:53 +0100 Message-Id: <20181124092253.6225-1-mhei@heimpold.de> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181124_012308_864484_F95DAC9C X-CRM114-Status: UNSURE ( 7.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a01:238:20a:202:5301:0:0:5 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH] fstools: guard usage of WEXITSTATUS X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openwrt-devel.lists.openwrt.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/openwrt-devel/> List-Post: <mailto:openwrt-devel@lists.openwrt.org> List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe> Cc: Michael Heimpold <mhei@heimpold.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org> Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org |
Series |
[OpenWrt-Devel] fstools: guard usage of WEXITSTATUS
|
expand
|
diff --git a/block.c b/block.c index 8e08310..b01a633 100644 --- a/block.c +++ b/block.c @@ -757,8 +757,10 @@ static void check_filesystem(struct probe_info *pr) int status; waitpid(pid, &status, 0); - if (WEXITSTATUS(status)) + if (WIFEXITED(status) && WEXITSTATUS(status)) ULOG_ERR("check_filesystem: %s returned %d\n", ckfs, WEXITSTATUS(status)); + if (WIFSIGNALED(status)) + ULOG_ERR("check_filesystem: %s terminated by %s\n", ckfs, strsignal(WTERMSIG(status))); } }
According to man page, using WEXITSTATUS should be guarded by a check of WIFEXITED, so add this check. While at, also print an error message in case fsck was terminated by a signal. Signed-off-by: Michael Heimpold <mhei@heimpold.de> --- block.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)