Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2822787rwb; Mon, 15 Aug 2022 12:03:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR5qdjVSH3vbR4OTbRZPMwZ9u2RhD/AW1IRWCQ1O+CGGv/yi/qRHmbin0bh6lXDcLEzwUdMl X-Received: by 2002:a05:6402:90e:b0:443:ec4b:2b03 with SMTP id g14-20020a056402090e00b00443ec4b2b03mr2444780edz.71.1660590213389; Mon, 15 Aug 2022 12:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660590213; cv=none; d=google.com; s=arc-20160816; b=ry6Hj/8Zdv2u2IPGB6Yy4r/QH5wz9IoXf+n+KaMiHHqi6y/NFhlkn+me8/FVOb5TSP 8x678dPphnVitDmK7L0k81T0gl8lsSrAwRfUqpDhvO757scbWcOZ8eQ+mJzYACzuZ/dy BSImGYJ6YpMTL63amQQLK0mLecncfOGh8mgXd8aOU2/FutcLSB72ZvjaJEsvxNdKPcU2 kOCtCCU7x84z7Y3jx9phIJuKMWp3oTLlzGLF7pMMhlt4wP1fjwNJHaftzLdUimNFwEu5 4nda1ocqC6XxoRbp6eRBNeW/En/HX0tWnkjaE3mgkfP+a+5pcyUskbWq4zoIT1xzJNMT Ptcw== 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=FNg1eJ6Bli34AAgQ5tq0r0PFVEJLJhiDt5X8eBeg1CRmIyyrM7n2scVm9CBNJXol0C BlElHh31Xd7L/4Z7UwLnxF008/p5PZEl9OX9S4t+s9O7SghRlK8Ta9OiEZq1Et/dPqYB 02nSb7gjMltaBaeWo5sTFMs7ZMOUgBJQToQ/Kof0fRnQWPfq3LJxqpECxAZIOdLu2XL6 aBa21zTkcxbho8BqOB3GnPWrAwOJvGHX/aTo+gDcNJ7DQMfbU26lubjoeP5cfx8HG7TL 2HHkvPL/OzOYhQTutpTF0aPaCgBAxazkCDvpDYAFUN4yOV+DdpoSKKhfoZq54zKzoaMd taDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HyP5tqYf; 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 hp26-20020a1709073e1a00b0072f66504cc1si10016053ejc.334.2022.08.15.12.02.39; Mon, 15 Aug 2022 12:03:33 -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=HyP5tqYf; 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 S240092AbiHOS7G (ORCPT + 99 others); Mon, 15 Aug 2022 14:59:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244894AbiHOS4N (ORCPT ); Mon, 15 Aug 2022 14:56:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF5EC175AD; Mon, 15 Aug 2022 11:30:37 -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 DF996B8106E; Mon, 15 Aug 2022 18:30:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BD51C433C1; Mon, 15 Aug 2022 18:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588234; bh=wuOSQasS4O7g9t9kdiLWCgRp6fK3GbiBlpL7zqz9SuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HyP5tqYfmQfmu5t4irsYSV7a5oqjMMvNjVQMPO9pxydkS4hB5cvrmMVNJg7AfR/Au ppE490xdWP2GMDhJYUDqar/5MRwqZwoedwOe1qkRXzo6wXvjz8JLOYZriSPdA/+mu2 OUMLSpmXAx2ypCN4AsWgsCTT8kvhyXDzmphwxVtY= 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.15 338/779] selftests: timers: clocksource-switch: fix passing errors from child Date: Mon, 15 Aug 2022 19:59:42 +0200 Message-Id: <20220815180351.724522140@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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