From 976945aa0451cbf24f9579900234df54af50c573 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 29 May 2022 15:01:08 -0400 Subject: stat: Don't pass AT_NO_AUTOMOUNT on GNU Hurd before glibc 2.35 Link: https://buildd.debian.org/status/fetch.php?pkg=bfs&arch=hurd-i386&ver=2.6-1&stamp=1653764526 Link: https://sourceware.org/git/?p=glibc.git;a=commit;h=13710e7e6af6c8965cc9a63a0660cb4ce1966557 --- src/stat.c | 2 +- src/util.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/stat.c b/src/stat.c index ad57e65..b67ad0e 100644 --- a/src/stat.c +++ b/src/stat.c @@ -310,7 +310,7 @@ int bfs_stat(int at_fd, const char *at_path, enum bfs_stat_flags flags, struct b at_flags |= AT_SYMLINK_NOFOLLOW; } -#ifdef AT_NO_AUTOMOUNT +#if defined(AT_NO_AUTOMOUNT) && (!__GNU__ || BFS_GLIBC_PREREQ(2, 35)) at_flags |= AT_NO_AUTOMOUNT; #endif diff --git a/src/util.h b/src/util.h index b5c7d80..2e89af6 100644 --- a/src/util.h +++ b/src/util.h @@ -90,6 +90,12 @@ # define BFS_HAS_UTIL BFS_HAS_INCLUDE(, __NetBSD__) #endif +#ifdef __GLIBC_PREREQ +# define BFS_GLIBC_PREREQ(maj, min) __GLIBC_PREREQ(maj, min) +#else +# define BFS_GLIBC_PREREQ(maj, min) false +#endif + #if !defined(FNM_CASEFOLD) && defined(FNM_IGNORECASE) # define FNM_CASEFOLD FNM_IGNORECASE #endif -- cgit v1.2.3