aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-08-04 14:44:08 +0930
committerAndreas K. Hüttel <dilfridge@gentoo.org>2021-08-13 23:51:43 +0200
commitf67db4e63f2d6c69481e2d6b9f1b5175bcc73165 (patch)
tree702cb5ce114fb37c71fa8b736ea2703af8cafd67
parentbfd: Close the file descriptor if there is no archive fd (diff)
downloadbinutils-gdb-f67db4e63f2d6c69481e2d6b9f1b5175bcc73165.tar.gz
binutils-gdb-f67db4e63f2d6c69481e2d6b9f1b5175bcc73165.tar.bz2
binutils-gdb-f67db4e63f2d6c69481e2d6b9f1b5175bcc73165.zip
PR28156, rename.c doesn't compile with MinGW
Guard against lack of struct timespec definition. PR 28156 * rename.c (get_stat_atime, get_stat_mtime): Don't compile unless HAVE_UTIMENSAT is defined. (cherry picked from commit 47fcfcbadce36c7ccc00c69b4c80717a0d6b9288) (cherry picked from commit 2e8e5a93a17ed97927d8ee968182994db1c915e0)
-rw-r--r--binutils/rename.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/binutils/rename.c b/binutils/rename.c
index 8826917c18c..48ae3014806 100644
--- a/binutils/rename.c
+++ b/binutils/rename.c
@@ -131,6 +131,7 @@ get_stat_mtime_ns (struct stat const *st ATTRIBUTE_UNUSED)
# endif
}
+#if defined HAVE_UTIMENSAT
/* Return *ST's access time. */
static inline struct timespec
get_stat_atime (struct stat const *st)
@@ -158,6 +159,7 @@ get_stat_mtime (struct stat const *st)
return t;
#endif
}
+#endif
/* End FIXME. */
/* Set the times of the file DESTINATION to be the same as those in