Browse Source

libc/sysdeps/linux/common/utime.c: fix riscv32 build

Commit 48591e2a259d84247ae38f050bd58e6f7450bb77 forgot to update utime.c
resulting in the following riscv32 build failure with applications using
utime such as bzip2:

/home/buildroot/autobuild/instance-0/output-1/host/riscv32-buildroot-linux-uclibc/bin/ld.real: bzip2.o: in function `copyFileName':
bzip2.c:(.text+0x1fcc): undefined reference to `utime'

Fixes: 48591e2a259d84247ae38f050bd58e6f7450bb77
 - http://autobuild.buildroot.org/results/2e37d4e0bcef515fe9e643737419bfd26aa2833e

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Fabrice Fontaine 1 year ago
parent
commit
ca9049c9db
1 changed files with 2 additions and 2 deletions
  1. 2 2
      libc/sysdeps/linux/common/utime.c

+ 2 - 2
libc/sysdeps/linux/common/utime.c

@@ -9,7 +9,7 @@
 #include <sys/syscall.h>
 #include <utime.h>
 
-#if defined __NR_utimensat && !defined __NR_utime
+#if (defined(__NR_utimensat) || defined(__NR_utimensat_time64)) && !defined __NR_utime
 # include <fcntl.h>
 # include <stddef.h>
 
@@ -51,7 +51,7 @@ int utime(const char *file, const struct utimbuf *times)
 }
 #endif
 
-#if (defined __NR_utimensat && !defined __NR_utime) || \
+#if ((defined(__NR_utimensat) || defined(__NR_utimensat_time64)) && !defined __NR_utime) || \
 	defined __NR_utime || defined __NR_utimes
 libc_hidden_def(utime)
 #endif