Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3328948rwa; Tue, 23 Aug 2022 02:58:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR7nVvYCZHgyU0x/FQyYGDTg53ZsBUjOzpu7zdUtCnXz+X0fuCbXPYLj8ZomBSbQYhJRsW5c X-Received: by 2002:a17:907:7256:b0:73d:9c6b:35e2 with SMTP id ds22-20020a170907725600b0073d9c6b35e2mr1791319ejc.197.1661248719886; Tue, 23 Aug 2022 02:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248719; cv=none; d=google.com; s=arc-20160816; b=kfS726NFjJN7xOg8JM9vtE9RRQYRzkP3bnZQUlW9Dy22reqeu5Utxi3S5SC6monJrn lH31g0WcnbWCQRPJYzq8gU1WClYlMJUV5IR2kcEiWnkLWCdCRGyghNlPgeoNqM3lCOnf ac0EDzcfEQAJ+QbdkN5QiCxWaG+mHTMJpxSYn2OxL7twzpM5WYnKHi7y28hoyddHf4nV CvxVljVH7jnj+YL8eTJ5uu/K+27fanjsx1fSH7SS5tjD84FVlzn991pB2wiYrZ56/xvl CL3eWru6UMiq6hIB6prTFMRm8haMQZX/LH8SEGRr1JaIH3a5ELBTXt/iweuXTaZNYQha gFGg== 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=hZeH9NW/Da+xvQkNejZHHk1ePf2K8+0qs2exkNdTWLQEzrL7FwVq+OS1o0T5RO3LGJ tsISdJCrVjooGCIp7B3Fj1sZLdpXAmLrhCW6HHcjlRHPqW3iVUc+53k7lVADtZOGUvKh WSA4z/bGWQa/Za9BH3Vg3X8L7/XhhlTYfoP+jfX4Jgr4jIdmCs/yGYA07uUGSRxPJ4lU M7SpK9EwpoC5PHLT3rwSQm8PiLeFzryQulJdxeVo5/PbLXiPWIH10+ODQqAqyUOyZRRU DZhQKIYW4+mSJn77rcN5jOXJDFQhn5onVsEQeBqjofKItKXos1y724ajIMssSJeXNAYO k+Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L4W68bxR; 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 y2-20020a056402358200b004460976236bsi1942767edc.144.2022.08.23.02.58.14; Tue, 23 Aug 2022 02:58:39 -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=L4W68bxR; 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 S1352718AbiHWJls (ORCPT + 99 others); Tue, 23 Aug 2022 05:41:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242766AbiHWJj1 (ORCPT ); Tue, 23 Aug 2022 05:39:27 -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 016FA78BDF; Tue, 23 Aug 2022 01:41:09 -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 205E7B81C4A; Tue, 23 Aug 2022 08:40:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 628CBC433C1; Tue, 23 Aug 2022 08:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244023; bh=/bz97d8eC9tLEAccbjF2RV+Ifl5jlUarddDXwnlxLb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L4W68bxRP3FofIL6/LDNVmDyopE3TdZhUc8xtI0NkNpc7MhglzpBfPPVg7hDodT0K N0AGaq4IC4+mUlArXxqMROv+k/ikHoFCaWQtnJoBa6Uwkf9Ao1yFGuo1GMDVYI1hv5 leVIxLAjv7Zm5HYLd7Bwg8JGA9IdM5HCVHuu2qhg= 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 4.14 074/229] selftests: timers: clocksource-switch: fix passing errors from child Date: Tue, 23 Aug 2022 10:23:55 +0200 Message-Id: <20220823080056.367643955@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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