From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 80CAB1F4B4 for ; Sat, 9 Jan 2021 01:58:19 +0000 (UTC) Received: from localhost ([::1]:37260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ky3WE-0005RQ-60 for normalperson@yhbt.net; Fri, 08 Jan 2021 20:58:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ky3W8-0005RF-Al for bug-gnulib@gnu.org; Fri, 08 Jan 2021 20:58:12 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:54218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ky3W5-0007ng-Qr for bug-gnulib@gnu.org; Fri, 08 Jan 2021 20:58:11 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6C8611600CD; Fri, 8 Jan 2021 17:58:07 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id mQ3XJH0THdvu; Fri, 8 Jan 2021 17:58:06 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 582A61600F1; Fri, 8 Jan 2021 17:58:06 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id C7SU0XR7nV8T; Fri, 8 Jan 2021 17:58:06 -0800 (PST) Received: from [192.168.1.9] (cpe-23-243-218-95.socal.res.rr.com [23.243.218.95]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 254871600CD; Fri, 8 Jan 2021 17:58:06 -0800 (PST) To: Adhemerval Zanella References: <20210104170349.3681241-1-adhemerval.zanella@linaro.org> From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: [PATCH 1/2] posix: Sync tempname with gnulib [BZ #26648] Message-ID: <4fcd6040-263a-0278-fe84-914dacb6e992@cs.ucla.edu> Date: Fri, 8 Jan 2021 17:58:05 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210104170349.3681241-1-adhemerval.zanella@linaro.org> Content-Type: multipart/mixed; boundary="------------5487A1C77DB9631D29BD35D1" Content-Language: en-US Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.241, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libc-alpha@sourceware.org, bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" This is a multi-part message in MIME format. --------------5487A1C77DB9631D29BD35D1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 1/4/21 9:03 AM, Adhemerval Zanella wrote: > -# define __lstat64(version, file, buf) lstat (file, buf) > +# define __lxstat64(version, file, buf) lstat (file, buf) That change isn't quite right for the !_LIBC case, since it doesn't=20 define the __stat64 macro and it defines __lstat64 with the wrong API. I installed the attached patch into Gnulib, which should do the change=20 right for both Gnulib and glibc, the idea being that the Gnulib and=20 glibc source files can be identical. --------------5487A1C77DB9631D29BD35D1 Content-Type: text/x-patch; charset=UTF-8; name="0001-tempname-sync-with-proposed-glibc-patch.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-tempname-sync-with-proposed-glibc-patch.patch" =46rom 8eb0e08598b9815f0e85ce1bde676169920087ef Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 8 Jan 2021 17:31:28 -0800 Subject: [PATCH] tempname: sync with proposed glibc patch This is from Adhemerval Zanella in: https://sourceware.org/pipermail/libc-alpha/2021-January/121301.html * lib/tempname.c (__lxstat64): Remove. (__lstat64, __stat64): New replacement macros. All uses changed. --- ChangeLog | 6 ++++++ lib/tempname.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2787f59a..812888f8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2021-01-08 Paul Eggert =20 + tempname: sync with proposed glibc patch + This is from Adhemerval Zanella in: + https://sourceware.org/pipermail/libc-alpha/2021-January/121301.html + * lib/tempname.c (__lxstat64): Remove. + (__lstat64, __stat64): New replacement macros. All uses changed. + regex: stop using alloca * lib/regex_internal.h: Do not include or define __libc_use_alloca or alloca. Patch written by Adhemerval Zanella: diff --git a/lib/tempname.c b/lib/tempname.c index 9ed67fec2..f196b9862 100644 --- a/lib/tempname.c +++ b/lib/tempname.c @@ -61,7 +61,8 @@ # define __gen_tempname gen_tempname # define __mkdir mkdir # define __open open -# define __lxstat64(version, file, buf) lstat (file, buf) +# define __lstat64(file, buf) lstat (file, buf) +# define __stat64(file, buf) stat (file, buf) # define __getrandom getrandom # define __clock_gettime64 clock_gettime # define __timespec64 timespec @@ -96,7 +97,7 @@ static int direxists (const char *dir) { struct_stat64 buf; - return __xstat64 (_STAT_VER, dir, &buf) =3D=3D 0 && S_ISDIR (buf.st_mo= de); + return __stat64 (dir, &buf) =3D=3D 0 && S_ISDIR (buf.st_mode); } =20 /* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is @@ -188,7 +189,7 @@ try_nocreate (char *tmpl, void *flags _GL_UNUSED) { struct_stat64 st; =20 - if (__lxstat64 (_STAT_VER, tmpl, &st) =3D=3D 0 || errno =3D=3D EOVERFL= OW) + if (__lstat64 (tmpl, &st) =3D=3D 0 || errno =3D=3D EOVERFLOW) __set_errno (EEXIST); return errno =3D=3D ENOENT ? 0 : -1; } --=20 2.27.0 --------------5487A1C77DB9631D29BD35D1--