diff options
author | Florian Weimer <fweimer@redhat.com> | 2020-03-05 16:09:52 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2020-03-05 16:09:52 +0100 |
commit | c10826a3277aa7fc0040c0fa18e60cafbab26edf (patch) | |
tree | f00861666ac0f1f4b45b5eb045a15dcf55a7e676 /sysdeps/unix/sysv/linux/utimes.c | |
parent | 13010976653675db489292dd4e253af2b5be2557 (diff) | |
download | glibc-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/utimes.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/utimes.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/utimes.c b/sysdeps/unix/sysv/linux/utimes.c index 75927b6ec6..a6809876fd 100644 --- a/sysdeps/unix/sysv/linux/utimes.c +++ b/sysdeps/unix/sysv/linux/utimes.c @@ -17,6 +17,7 @@ <https://www.gnu.org/licenses/>. */ #include <time.h> +#include <fcntl.h> int __utimes64 (const char *file, const struct __timeval64 tvp[2]) @@ -29,7 +30,7 @@ __utimes64 (const char *file, const struct __timeval64 tvp[2]) ts64[1] = timeval64_to_timespec64 (tvp[1]); } - return __utimensat64_helper (0, file, tvp ? ts64 : NULL, 0); + return __utimensat64_helper (AT_FDCWD, file, tvp ? ts64 : NULL, 0); } #if __TIMESIZE != 64 |