Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1863832rwb; Fri, 19 Aug 2022 10:38:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR5KK8SIctaOELeJ+sVQ5ALLgSSM8qYErmsXyx9jHTvCxk7X2zQmC+oZMYoTT4Ol30kM27bQ X-Received: by 2002:a17:903:2302:b0:172:bf0e:35b9 with SMTP id d2-20020a170903230200b00172bf0e35b9mr4781929plh.160.1660930727537; Fri, 19 Aug 2022 10:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930727; cv=none; d=google.com; s=arc-20160816; b=HDfxsaGfGdCuTQA1fjcf06bX9r7tggjJDam4ZrqRcB7WpqWuhYZwuXpromVqLWjUGS VtB8sSGTvq5pLmvHRsP+1RYWo7b8r0YlMR/eALm7NY4J9CzZmqjh108BhomDoFxpGcem g1yTeE118oeJuzoZBaexW3Z8kmqlUSwCLG8a/6fhP4AcwJT8wSpSGJfvG9hhTOxUUeAg /21sCI2b4MFktsK1cRNHloyiPFeZnguapWqR1P+Qy6shgTN/s8njlqT/zlBMwrlf8vYh nQ5c9qp5Okj72/5Nsqrh8E/SpDdAhFEm8k+HrQ6ICBzjk+ghb/7cpEqGFajdYBMeNSsV sIFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GI/aw6qwQOB2StdE7L6hFTx1Pk2hJN9NDhePxwNFk4M=; b=WSfsTUaJt0jgmeSDuHWrvVat1MtDarDepMrnGFa9gK+sTXm1E9fgUfSJYjmBSKcoGs 57A0HYHTE/spEG+/Mgiw2NyMHU+c8lKA/X2MoDyt/KOdrySgpUkfDhzo0qtaTXEMF0LB S+IDT5VHlMs6nsnwImKByDKVP3FZ0kCSh9JaBCFj0gqquleL6FH1dMHDuPXGkTBg7C9p VOHQ7Sy1XyMDYAOXN8r2x49f+D9TyY2B+Qh0BoSshqEOmQVGximwph+zxlxLGRFns2Kc izxGIk/mNjDPFxT5V3j8kaaK+jTxm2RTxydWt6xj7/+LE50Ktkx2CSEo6Qf8eSBBzgQ0 L1xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="WTWly/4l"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id om9-20020a17090b3a8900b001f28dc085bfsi875934pjb.115.2022.08.19.10.38.36; Fri, 19 Aug 2022 10:38:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="WTWly/4l"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351843AbiHSQMd (ORCPT + 99 others); Fri, 19 Aug 2022 12:12:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351930AbiHSQLD (ORCPT ); Fri, 19 Aug 2022 12:11:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61DCD11231E; Fri, 19 Aug 2022 08:56:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 134B6B82819; Fri, 19 Aug 2022 15:56:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42FABC43140; Fri, 19 Aug 2022 15:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924616; bh=/bz97d8eC9tLEAccbjF2RV+Ifl5jlUarddDXwnlxLb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WTWly/4lAAMJp8TTX5S2Ia4+lueVyqfeeRmvZx77R6r+x14Psj1nWySpY4/a7qzix qa2PZXDIQbJVkjMx8av5aEG24ieLRkvJ4jJZjGIWebaqwr9sLJJB8QKDir/WigTv/T pqbyzWTeR+2uRND5b373mBaMINwea8P8ujsQ1EiE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wolfram Sang , John Stultz , Shuah Khan , Sasha Levin Subject: [PATCH 5.10 228/545] selftests: timers: clocksource-switch: fix passing errors from child Date: Fri, 19 Aug 2022 17:39:58 +0200 Message-Id: <20220819153839.572434394@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wolfram Sang [ Upstream commit 4d8f52ac5fa9eede7b7aa2f2d67c841d9eeb655f ] The return value from system() is a waitpid-style integer. Do not return it directly because with the implicit masking in exit() it will always return 0. Access it with appropriate macros to really pass on errors. Fixes: 7290ce1423c3 ("selftests/timers: Add clocksource-switch test from timetest suite") Signed-off-by: Wolfram Sang Acked-by: John Stultz Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/timers/clocksource-switch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c index bfc974b4572d..c18313a5f357 100644 --- a/tools/testing/selftests/timers/clocksource-switch.c +++ b/tools/testing/selftests/timers/clocksource-switch.c @@ -110,10 +110,10 @@ int run_tests(int secs) sprintf(buf, "./inconsistency-check -t %i", secs); ret = system(buf); - if (ret) - return ret; + if (WIFEXITED(ret) && WEXITSTATUS(ret)) + return WEXITSTATUS(ret); ret = system("./nanosleep"); - return ret; + return WIFEXITED(ret) ? WEXITSTATUS(ret) : 0; } -- 2.35.1