From patchwork Tue May 31 16:24:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 54567 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF1EA395B438 for ; Tue, 31 May 2022 16:25:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF1EA395B438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1654014354; bh=nfbEnRg/mAO8pnFsgD8QgdWW8hghaOpuw9J1HBvw9rE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=NI2uX6iGI754JvLhpXQSlS5U5DM6ZFVGpDhrvl3FIHdhxeSiKzb3GyJOEbS+xEVKH 6IUX8vqsBrlMHcM3t+sHI3e289ImCbPMl+of9dU33YI8JUj7r51Dv0HaBm8s52dGOs oIvYix0sKJBAc2q1yeQCmTq7IkQxf3kWIMwNYMQA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by sourceware.org (Postfix) with ESMTPS id 39408395B407 for ; Tue, 31 May 2022 16:24:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 39408395B407 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-e93bbb54f9so18970476fac.12 for ; Tue, 31 May 2022 09:24:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nfbEnRg/mAO8pnFsgD8QgdWW8hghaOpuw9J1HBvw9rE=; b=LUG5YsekYdyHoUTMLH5oha75NtouNj1IWMWF/HfmEYVKrH4Z5UJvKt924dRAa0obfj auD8gewKswErVw/uaZxgHdz2abduMEcDvAqkiuk+9ZmjDFw2WY9tpqc//niFrIEr0MCA 2JIDdKAsioPaiB0MB6bUSdiZoF5z33hi71y2EtqUGo+kr8JGUXnV5Cffjixmphu2ugnX tnxLS0ZTFfJOPfbJB1Y6ltdnSaszfZTI52lNz9cLe8qpuJg1r2ll4NHMR2JdavLy1CbC B6EExQHrW39cBXxHzVuvx/+sy+XX6DaLJj+cp1EiSU0JbgrDZgUm0BG4yW1VpyhOhU6m wJRQ== X-Gm-Message-State: AOAM532Xp2eFfvrznBKooiOUuK4LI3nW+Y99/w88FTk7UrhhFr/2izn/ repFS8nGaTiUdRh1A+0pMYEdge0m5lss3w== X-Google-Smtp-Source: ABdhPJwTcFK1qxrF5zqyC7O/qX5RdSIfUKj+zEaJciqFdVs4x6VdPuUa2KgjtLCRmvFgGrE+HgZLiQ== X-Received: by 2002:a05:6870:1791:b0:f2:38db:8f08 with SMTP id r17-20020a056870179100b000f238db8f08mr14241824oae.260.1654014291733; Tue, 31 May 2022 09:24:51 -0700 (PDT) Received: from birita.. ([2804:431:c7ca:e39c:980f:eaf1:7a30:10ef]) by smtp.gmail.com with ESMTPSA id z3-20020a056870d68300b000f24edeaf40sm3348648oap.45.2022.05.31.09.24.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 09:24:51 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 1/8] misc: Use 64 bit stat for daemon (BZ# 29203) Date: Tue, 31 May 2022 13:24:36 -0300 Message-Id: <20220531162443.2231918-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220531162443.2231918-1-adhemerval.zanella@linaro.org> References: <20220531162443.2231918-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, 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 server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This is a a missing spot initially done by 52a5fe70a2c77935. Trying to come up with a testcase it tricky because to create a /dev/null device it requires root access and even test-container there is no easy way to do it. Checked on i686-linux-gnu. --- misc/daemon.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/misc/daemon.c b/misc/daemon.c index 0e688f4d74..3c73ac2ab8 100644 --- a/misc/daemon.c +++ b/misc/daemon.c @@ -61,11 +61,10 @@ daemon (int nochdir, int noclose) (void)__chdir("/"); if (!noclose) { - struct stat64 st; + struct __stat64_t64 st; if ((fd = __open_nocancel(_PATH_DEVNULL, O_RDWR, 0)) != -1 - && (__builtin_expect (__fstat64 (fd, &st), 0) - == 0)) { + && __glibc_likely (__fstat64_time64 (fd, &st) == 0)) { if (__builtin_expect (S_ISCHR (st.st_mode), 1) != 0 #if defined DEV_NULL_MAJOR && defined DEV_NULL_MINOR && (st.st_rdev