Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3091231rwb; Mon, 15 Aug 2022 17:54:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR4YHf4mvK484F4jpyP5FsgntCeX/50VhV5OFeMEz3yJ5+Z7qLCkzk0MkUO9rQioedvyhQFA X-Received: by 2002:a17:907:7355:b0:730:65bc:e761 with SMTP id dq21-20020a170907735500b0073065bce761mr11763101ejc.145.1660611292024; Mon, 15 Aug 2022 17:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611292; cv=none; d=google.com; s=arc-20160816; b=T5C5KfygIM/GDy2vZvOieilAVZwFqDuzwOFgsStOYDnME6HYqn7GOqLeb3loMNr+ru P6TNNBOCuUX0Hv8CdcCICN9IamQHcw0+R9GJ+vSgNgJgP1gtfQV71Y8KH/vHz2z7vehX PT1rWdg1TFU7pZ2/d1Rc4kvvg1Op0fUaVUImS67EP9NF/yKijz6Yx1GN0CF9KXrXzBuh JDuQ5gc3wEcTOWu2JmuVLbf3+I7uX6gZ+wqUsHXmgzjBHCETQ3R22bHwbM9xDuhscB7k zM999TRxF9R5useK6RdV1QeinOBMt7tgy2yVPKAIHIwRSup8JWkIsj5YDSq4OQuJupUq oqrA== 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=Ej8BrZ/G3tPpxEDCQHlgpM3nl7GypvziAB7TTB80+65EHbrzVkptAmyyjYmt4FCcnW D4mgzxxFcHu3Caq5We+3T6yxjmDxi3rlFeC5ZRBdMztDXHbfuF1YpIP0cZr+PLarCp5h W+RwBmt96jLAF2YpsRTcWfzz9xPbCbKq1JY4n2ZxNlw3m5gnrMvKZZnkBTFO1UYRKz9+ qehZMzOsy6aYOYlG1Z3rS4/bm0RQwXC9pcS0jVcweoLGxDMcCEC2bTFmEB6acBia2+tQ FETH3E2XwixgFRRONozGMnV/9E6mN+uPU8kMqkC5YGYvuctoEymPbSXjYtha8TuRriyj 74uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="iNZ/QrQ0"; 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 f25-20020a170906495900b007311135dc53si7318869ejt.809.2022.08.15.17.54.26; Mon, 15 Aug 2022 17:54:52 -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="iNZ/QrQ0"; 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 S1343949AbiHOX6y (ORCPT + 99 others); Mon, 15 Aug 2022 19:58:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355346AbiHOXv4 (ORCPT ); Mon, 15 Aug 2022 19:51:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C64333409; Mon, 15 Aug 2022 13:16:36 -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 AB985B80EA8; Mon, 15 Aug 2022 20:16:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D751C433C1; Mon, 15 Aug 2022 20:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594593; bh=wuOSQasS4O7g9t9kdiLWCgRp6fK3GbiBlpL7zqz9SuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iNZ/QrQ08QPRv+ktwQlqgAQNuS+DUM3paSLCqcmhg7ekqZfVvu1qa9zA/uSS9YSPM iP2dPs1hUKbbqKMN8NpkOG1AZGn0+LVRo4aRj4sX8miAEBn8kipluNIdDGzwKDNGTB wkMZ5edcbNhCWEYsKsXYFg7DjPZf27bUWg3w36RI= 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.19 0497/1157] selftests: timers: clocksource-switch: fix passing errors from child Date: Mon, 15 Aug 2022 19:57:33 +0200 Message-Id: <20220815180459.554498733@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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