From patchwork Wed Jun 21 12:58:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 13287249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11B68EB64D7 for ; Wed, 21 Jun 2023 12:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231671AbjFUM7m (ORCPT ); Wed, 21 Jun 2023 08:59:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231156AbjFUM7l (ORCPT ); Wed, 21 Jun 2023 08:59:41 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F326FAC; Wed, 21 Jun 2023 05:59:38 -0700 (PDT) X-QQ-mid: bizesmtp73t1687352369te3lj68z Received: from linux-lab-host.localdomain ( [116.30.126.60]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 21 Jun 2023 20:59:28 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: xwvWJGGFd7Pp39HRCTQYRbgJy3bbvGHQ7WlZR48+2RLviBp/41ZiQ96oKRZr/ SilZzV0NenGnJQOAoEBB0FsmiBH7+SiFV9oelPczpDc5Rv6vON7sAY8uZqZwSd+t40quVga UlD5ndGNbGYHcYN65235Szzzn+W3uQJbRs+cM5+xVrvNtkhz8C96FkkUB4g30N+3iiIrT18 IQ6Ef+55Bvl/Wb4QA6h+fvhx0tjuE67lIQ90/3id1+HCtIisliMmEsk8Ug9bqvYo0ghVbrP B7xN3wcVi695bHsw5s8IapJuwl+GKCEXCNiaucghBROurHs1Z2GS5Y9guTFLTImqjkXOMkJ m22jHKU242jcgYr6CLmUguUae2HlOWvJPWimeF9ZtAi9dq0bot3TJaA2a7Ar64D7EGcWIyU X-QQ-GoodBg: 0 X-BIZMAIL-ID: 18004566144104333474 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v1 05/17] selftests/nolibc: stat_timestamps: remove procfs dependency Date: Wed, 21 Jun 2023 20:58:58 +0800 Message-Id: <5f80f3dae60f77c6b746578113e56c8fa6454143.1687344643.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Since it is not really necessary to use /proc/self here, instead of adding a condition check, we use the always existing '/' path instead of /proc/self, this eventually let it work without procfs. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/nolibc-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index ebec948ec808..2ef44176f7a9 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -520,7 +520,7 @@ static int test_stat_timestamps(void) if (sizeof(st.st_atim.tv_sec) != sizeof(st.st_atime)) return 1; - if (stat("/proc/self/", &st)) + if (stat("/", &st)) return 1; if (st.st_atim.tv_sec != st.st_atime || st.st_atim.tv_nsec > 1000000000)