From patchwork Thu Mar 5 12:30:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 38427 Received: (qmail 56852 invoked by alias); 5 Mar 2020 12:30:42 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 50911 invoked by uid 89); 5 Mar 2020 12:30:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583411412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h7A3jIyI0SW527Qxe/avVjorYZsUvXeZOrXGlJXMQ54=; b=Q+eekzEE8R5jf7xmjUX9CLegAU1S2Ds2H+zR3cVSbeuXhxwxwcZc2tGMa2ag1WkLR+X/sP gv7Xxrubz9699zWFRzw9JbYW85MQi1+zS7/DleERgk0b7Mx3uxpMo3WEnbmSVzayr98tB1 1nWfJnSjqF/iVcfmZWlUH0IE6Rd9ZDo= From: Florian Weimer To: libc-alpha@sourceware.org Cc: Lukasz Majewski , Adhemerval Zanella Subject: Re: [PATCH] Linux: Use AT_FDCWD in utime, utimes when calling utimensat References: <87sgin9fqf.fsf@oldenburg2.str.redhat.com> Date: Thu, 05 Mar 2020 13:30:04 +0100 In-Reply-To: <87sgin9fqf.fsf@oldenburg2.str.redhat.com> (Florian Weimer's message of "Thu, 05 Mar 2020 12:57:12 +0100") Message-ID: <87h7z39e7n.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com * Florian Weimer: > 0 is a valid descriptor without any special meaning. > > ----- > sysdeps/unix/sysv/linux/utime.c | 2 +- > sysdeps/unix/sysv/linux/utimes.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sysdeps/unix/sysv/linux/utime.c b/sysdeps/unix/sysv/linux/utime.c > index 2cd9334a6f..6516344adc 100644 > --- a/sysdeps/unix/sysv/linux/utime.c > +++ b/sysdeps/unix/sysv/linux/utime.c > @@ -32,7 +32,7 @@ __utime64 (const char *file, const struct __utimbuf64 *times) > ts64[1].tv_nsec = 0LL; > } > > - return __utimensat64_helper (0, file, times ? ts64 : NULL, 0); > + return __utimensat64_helper (AT_FDCWD, file, times ? ts64 : NULL, 0); > } > > #if __TIMESIZE != 64 > diff --git a/sysdeps/unix/sysv/linux/utimes.c b/sysdeps/unix/sysv/linux/utimes.c > index 75927b6ec6..02a5e91415 100644 > --- a/sysdeps/unix/sysv/linux/utimes.c > +++ b/sysdeps/unix/sysv/linux/utimes.c > @@ -29,7 +29,7 @@ __utimes64 (const char *file, const struct __timeval64 tvp[2]) > ts64[1] = timeval64_to_timespec64 (tvp[1]); > } > > - return __utimensat64_helper (0, file, tvp ? ts64 : NULL, 0); > + return __utimensat64_helper (AT_FDCWD, file, tvp ? ts64 : NULL, 0); > } > > #if __TIMESIZE != 64 There's a missing in this patch, it should read: Florian Reviewed-by: Lukasz Majewski diff --git a/sysdeps/unix/sysv/linux/utime.c b/sysdeps/unix/sysv/linux/utime.c index 2cd9334a6f..8665ef2636 100644 --- a/sysdeps/unix/sysv/linux/utime.c +++ b/sysdeps/unix/sysv/linux/utime.c @@ -18,6 +18,7 @@ #include #include +#include int __utime64 (const char *file, const struct __utimbuf64 *times) @@ -32,7 +33,7 @@ __utime64 (const char *file, const struct __utimbuf64 *times) ts64[1].tv_nsec = 0LL; } - return __utimensat64_helper (0, file, times ? ts64 : NULL, 0); + return __utimensat64_helper (AT_FDCWD, file, times ? ts64 : NULL, 0); } #if __TIMESIZE != 64 diff --git a/sysdeps/unix/sysv/linux/utimes.c b/sysdeps/unix/sysv/linux/utimes.c index 75927b6ec6..a6809876fd 100644 --- a/sysdeps/unix/sysv/linux/utimes.c +++ b/sysdeps/unix/sysv/linux/utimes.c @@ -17,6 +17,7 @@ . */ #include +#include int __utimes64 (const char *file, const struct __timeval64 tvp[2]) @@ -29,7 +30,7 @@ __utimes64 (const char *file, const struct __timeval64 tvp[2]) ts64[1] = timeval64_to_timespec64 (tvp[1]); } - return __utimensat64_helper (0, file, tvp ? ts64 : NULL, 0); + return __utimensat64_helper (AT_FDCWD, file, tvp ? ts64 : NULL, 0); } #if __TIMESIZE != 64