public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/azanella/y2038] linux: Simplify utimensat
Date: Thu, 30 Jul 2020 13:25:22 +0000 (GMT)	[thread overview]
Message-ID: <20200730132522.18550382E05D@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=257683dba0d2ea31180c0b672d050b2cdbbc7d66

commit 257683dba0d2ea31180c0b672d050b2cdbbc7d66
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Jul 10 15:13:48 2020 -0300

    linux: Simplify utimensat
    
    With arch-syscall.h it can now assumes the existance of either
    __NR_utimensat or __NR_utimensat_time64.  The 32-bit time_t
    support is now only build for !__ASSUME_TIME64_SYSCALLS.
    
    Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
    kernel).

Diff:
---
 sysdeps/unix/sysv/linux/utimensat.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/utimensat.c b/sysdeps/unix/sysv/linux/utimensat.c
index eb16f0f3d5..ea23c2f051 100644
--- a/sysdeps/unix/sysv/linux/utimensat.c
+++ b/sysdeps/unix/sysv/linux/utimensat.c
@@ -28,18 +28,15 @@ int
 __utimensat64_helper (int fd, const char *file,
                       const struct __timespec64 tsp64[2], int flags)
 {
-#ifdef __ASSUME_TIME64_SYSCALLS
-# ifndef __NR_utimensat_time64
-#  define __NR_utimensat_time64 __NR_utimensat
-# endif
-  return INLINE_SYSCALL (utimensat_time64, 4, fd, file, &tsp64[0], flags);
-#else
-# ifdef __NR_utimensat_time64
-  int ret = INLINE_SYSCALL (utimensat_time64, 4, fd, file, &tsp64[0], flags);
+#ifndef __NR_utimensat_time64
+# define __NR_utimensat_time64 __NR_utimensat
+#endif
+  int ret = INLINE_SYSCALL_CALL (utimensat_time64, fd, file, &tsp64[0], flags);
+#ifndef __ASSUME_TIME64_SYSCALLS
   if (ret == 0 || errno != ENOSYS)
     return ret;
-# endif
-  if (tsp64
+
+  if (tsp64 != NULL
       && (! in_time_t_range (tsp64[0].tv_sec)
           || ! in_time_t_range (tsp64[1].tv_sec)))
     {
@@ -54,10 +51,10 @@ __utimensat64_helper (int fd, const char *file,
       tsp32[1] = valid_timespec64_to_timespec (tsp64[1]);
     }
 
-  return INLINE_SYSCALL (utimensat, 4, fd, file, tsp64 ? &tsp32[0] : NULL,
-                         flags);
+  ret = INLINE_SYSCALL_CALL (utimensat, fd, file, tsp64 ? &tsp32[0] : NULL,
+			     flags);
 #endif
-
+  return ret;
 }
 libc_hidden_def (__utimensat64_helper)


                 reply	other threads:[~2020-07-30 13:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200730132522.18550382E05D@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).