about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/futimens.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/futimens.c b/sysdeps/unix/sysv/linux/futimens.c
index 67f2588f86..fe8e92070d 100644
--- a/sysdeps/unix/sysv/linux/futimens.c
+++ b/sysdeps/unix/sysv/linux/futimens.c
@@ -33,6 +33,11 @@ int
 futimens (int fd, const struct timespec tsp[2])
 {
 #ifdef __NR_utimensat
+  if (fd < 0)
+    {
+      __set_errno (EBADF);
+      return -1;
+    }
   return INLINE_SYSCALL (utimensat, 4, fd, NULL, tsp, 0);
 #else
   __set_errno (ENOSYS);