From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 469A9386F430; Mon, 24 Aug 2020 18:34:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 469A9386F430 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] linux: Simplify utimensat X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: 278498a1c0b63a975bf238e897aaadaa7847d4d8 X-Git-Newrev: f032f3af2cfc4b97bde0fc61259380f83d543495 Message-Id: <20200824183409.469A9386F430@sourceware.org> Date: Mon, 24 Aug 2020 18:34:09 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 18:34:09 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f032f3af2cfc4b97bde0fc61259380f83d543495 commit f032f3af2cfc4b97bde0fc61259380f83d543495 Author: Adhemerval Zanella 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). Reviewed-by: Lukasz Majewski 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)