From: Po Lu Date: Wed, 8 Mar 2023 13:18:50 +0000 (+0800) Subject: Update Android port X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1bf8fd61c5c4781a4f00ea4a4465915c04dcb659;p=emacs.git Update Android port * src/fileio.c (Fcopy_file): On Android, ignore ENOSYS and ENOTSUP when restoring file times, as the system call used is supported by many kernels. --- diff --git a/src/fileio.c b/src/fileio.c index 88582704d7e..99f710ccbf0 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2495,7 +2495,17 @@ permissions. */) struct timespec ts[2]; ts[0] = get_stat_atime (&st); ts[1] = get_stat_mtime (&st); - if (futimens (ofd, ts) != 0) + if (futimens (ofd, ts) != 0 + /* Various versions of the Android C library are missing + futimens, which leads a gnulib fallback to be installed + that uses fdutimens instead. However, fdutimens is not + supported on many Android kernels, so just silently fail + if errno is ENOTSUP or ENOSYS. */ +#if defined HAVE_ANDROID && !defined ANDROID_STUBIFY + && errno != ENOTSUP + && errno != ENOSYS +#endif + ) xsignal2 (Qfile_date_error, build_string ("Cannot set file date"), newname); }