about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/utime.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-03-05 16:09:52 +0100
committerFlorian Weimer <fweimer@redhat.com>2020-03-05 16:09:52 +0100
commitc10826a3277aa7fc0040c0fa18e60cafbab26edf (patch)
treef00861666ac0f1f4b45b5eb045a15dcf55a7e676 /sysdeps/unix/sysv/linux/utime.c
parent13010976653675db489292dd4e253af2b5be2557 (diff)
downloadglibc-c10826a3277aa7fc0040c0fa18e60cafbab26edf.tar.gz
glibc-c10826a3277aa7fc0040c0fa18e60cafbab26edf.tar.xz
glibc-c10826a3277aa7fc0040c0fa18e60cafbab26edf.zip
Linux: Use AT_FDCWD in utime, utimes when calling utimensat
0 is a valid descriptor without any special meaning.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'sysdeps/unix/sysv/linux/utime.c')
-rw-r--r--sysdeps/unix/sysv/linux/utime.c3
1 files changed, 2 insertions, 1 deletions
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 <utime.h>
 #include <time.h>
+#include <fcntl.h>
 
 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