Patchwork [2/2] Remove __NR_utimensat

login
register
mail settings
Submitter Aurelien Jarno
Date March 22, 2016, 8:30 p.m.
Message ID <1458678640-29310-2-git-send-email-aurelien@aurel32.net>
Download mbox | patch
Permalink /patch/11476/
State New
Headers show

Comments

Aurelien Jarno - March 22, 2016, 8:30 p.m.
With the 2.6.32 minimum kernel on x86 and 3.2 on other architectures,
__NR_utimensat is always defined.

Changelog:
	* sysdeps/unix/sysv/linux/futimens.c (futimens) [__NR_utimensat]:
	Make code unconditional.
	[!__NR_utimensat]: Remove conditional code.
	* sysdeps/unix/sysv/linux/lutimes.c (lutimes) [__NR_utimensat]:
	Make code unconditional.
	[!__NR_utimensat]: Remove conditional code.
	* sysdeps/unix/sysv/linux/utimensat.c (utimensat) [__NR_utimensat]:
	Make code unconditional.
	[!__NR_utimensat]: Remove conditional code.
---
 ChangeLog                           | 12 ++++++++++++
 sysdeps/unix/sysv/linux/futimens.c  |  7 -------
 sysdeps/unix/sysv/linux/lutimes.c   |  8 --------
 sysdeps/unix/sysv/linux/utimensat.c |  7 -------
 4 files changed, 12 insertions(+), 22 deletions(-)
Florian Weimer - March 22, 2016, 9:44 p.m.
* Aurelien Jarno:

> With the 2.6.32 minimum kernel on x86 and 3.2 on other architectures,
> __NR_utimensat is always defined.

Similar comment about the commit message applies.  Otherwise looks
good.  Thanks.

Patch

diff --git a/ChangeLog b/ChangeLog
index c403722..6d04d97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@ 
 2016-03-22  Aurelien Jarno  <aurelien@aurel32.net>
 
+	* sysdeps/unix/sysv/linux/futimens.c (futimens) [__NR_utimensat]:
+	Make code unconditional.
+	[!__NR_utimensat]: Remove conditional code.
+	* sysdeps/unix/sysv/linux/lutimes.c (lutimes) [__NR_utimensat]:
+	Make code unconditional.
+	[!__NR_utimensat]: Remove conditional code.
+	* sysdeps/unix/sysv/linux/utimensat.c (utimensat) [__NR_utimensat]:
+	Make code unconditional.
+	[!__NR_utimensat]: Remove conditional code.
+
+2016-03-22  Aurelien Jarno  <aurelien@aurel32.net>
+
 	* sysdeps/unix/sysv/linux/dl-openat64.c (openat64) [__NR_openat]:
 	Make code unconditional.
 
diff --git a/sysdeps/unix/sysv/linux/futimens.c b/sysdeps/unix/sysv/linux/futimens.c
index 3176e65..3f96210 100644
--- a/sysdeps/unix/sysv/linux/futimens.c
+++ b/sysdeps/unix/sysv/linux/futimens.c
@@ -31,15 +31,8 @@ 
 int
 futimens (int fd, const struct timespec tsp[2])
 {
-#ifdef __NR_utimensat
   if (fd < 0)
     return INLINE_SYSCALL_ERROR_RETURN_VALUE (EBADF);
   /* Avoid implicit array coercion in syscall macros.  */
   return INLINE_SYSCALL (utimensat, 4, fd, NULL, &tsp[0], 0);
-#else
-  return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-#endif
 }
-#ifndef __NR_utimensat
-stub_warning (futimens)
-#endif
diff --git a/sysdeps/unix/sysv/linux/lutimes.c b/sysdeps/unix/sysv/linux/lutimes.c
index 69d3cfa..49fad3e 100644
--- a/sysdeps/unix/sysv/linux/lutimes.c
+++ b/sysdeps/unix/sysv/linux/lutimes.c
@@ -27,7 +27,6 @@ 
 int
 lutimes (const char *file, const struct timeval tvp[2])
 {
-#ifdef __NR_utimensat
   /* The system call espects timespec, not timeval.  */
   struct timespec ts[2];
   if (tvp != NULL)
@@ -42,11 +41,4 @@  lutimes (const char *file, const struct timeval tvp[2])
 
   return INLINE_SYSCALL (utimensat, 4, AT_FDCWD, file, tvp ? ts : NULL,
 			 AT_SYMLINK_NOFOLLOW);
-#else
-  return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-#endif
 }
-
-#ifndef __NR_utimensat
-stub_warning (lutimes)
-#endif
diff --git a/sysdeps/unix/sysv/linux/utimensat.c b/sysdeps/unix/sysv/linux/utimensat.c
index f3a9697..89af2f5 100644
--- a/sysdeps/unix/sysv/linux/utimensat.c
+++ b/sysdeps/unix/sysv/linux/utimensat.c
@@ -31,13 +31,6 @@  utimensat (int fd, const char *file, const struct timespec tsp[2],
 {
   if (file == NULL)
     return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-#ifdef __NR_utimensat
   /* Avoid implicit array coercion in syscall macros.  */
   return INLINE_SYSCALL (utimensat, 4, fd, file, &tsp[0], flags);
-#else
-  return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-#endif
 }
-#ifndef __NR_utimensat
-stub_warning (utimensat)
-#endif