Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2933825rwb; Mon, 15 Aug 2022 14:20:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR6VohYHxjgJbeFhy8cAq3/X8LY55cKfkzFhgTHR61yVH0L9m7Jy2oHhvU8JVp5MTOs8Dk2p X-Received: by 2002:a17:907:3d90:b0:730:a7d2:23f0 with SMTP id he16-20020a1709073d9000b00730a7d223f0mr11423523ejc.358.1660598434477; Mon, 15 Aug 2022 14:20:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598434; cv=none; d=google.com; s=arc-20160816; b=K231wmOsvJCo2e1x5So1EcAJUi/olF86/bh1L7mmF9W/KzIsoD8C2GjiQuzQRwvUFj et7KQMbpS25jR1nbMfDFjgOqgde9f1nWnBtVqW1eg/Dg4T1MUIhUYcDOC0PIEnwllhAY aIKoUOX1TeJ6VZ95//UO+AqX+waJt6AqHbgBYxMBOZhsBnvvLZFWijUbNY6mci0uOIBa rnQMACi8nPw4YQDcN3nyiMO+qyGIk3BwwSIyLiPW+L35fzF6iNa6NWq9qZHwo4FqU7Wi N8IeupmP5Fui4hrTzYIgZJllTFwbuB0uREGXXb+5XTMJJdG0a7lTSAK7joHdgKWL/RUt U3Bw== 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=ockgpK+dFjVmjcrDqJsnb1oasnjCuP/fm/TqSUUEpB4=; b=w/QMjqbnlog8Ij0C+/3sTT1uZHZBaqkMq2EHeCFSMgtbLST3xzEjgizG/2JBIGGWEh t1gViAEyeIfa39Ud+7R0764AQzz5vAHkIrO/nA3aCVk9bEO7JiR41Og3rraKBuAIDU82 9ciyeRW9yVnKeZLiuvc7xgymBDFQiQ5tPwFPfkWVN7RueLqGeIZvrRyBa/1yziON7clh aQdilKfzdJO2HfHPg2o6tkWduQjBmsIGemRj9YDW2EiMFdDVlNujWJhmKXmLirEE4stk FmZ+FTlNQhW+CiLmaW0+QKp1WrLGYqrMYbgu751ZcG4Upvon1AxeVXhDnq7Ch2ZQ/qtk 53dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cmSdyvie; 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 z9-20020aa7d409000000b00440367fe313si7339237edq.305.2022.08.15.14.20.06; Mon, 15 Aug 2022 14:20:34 -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=cmSdyvie; 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 S243965AbiHOVQJ (ORCPT + 99 others); Mon, 15 Aug 2022 17:16:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348022AbiHOVH4 (ORCPT ); Mon, 15 Aug 2022 17:07:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71722371A1; Mon, 15 Aug 2022 12:17:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 02B8E60EF0; Mon, 15 Aug 2022 19:17:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1C31C433D6; Mon, 15 Aug 2022 19:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591071; bh=wuOSQasS4O7g9t9kdiLWCgRp6fK3GbiBlpL7zqz9SuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cmSdyviezgaVPQu/OAadFy3pCkrSouCdpIHRAmdF2taW/uPtisTpfj4K2Ji1yw0jE TyuvgsDmmR7ksstz1+6XpqsqeTKVSYXnwnFbBsQSj4zQh3qrN0Hj5L426Rm9kES/hm 7wfE/+xVCwxOcBl24oJhMHKOEJ+MxJlWCoXiE6U0= 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.18 0461/1095] selftests: timers: clocksource-switch: fix passing errors from child Date: Mon, 15 Aug 2022 19:57:40 +0200 Message-Id: <20220815180448.675806950@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 ef8eb3604595..b57f0a9be490 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