From 003f2d04b6da8ead3dc47d10365a0a5900c30ef2 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Fri, 2 Apr 2021 14:06:44 -0400 Subject: [PATCH] FreeBSD: Fix stable/12 after AT_BENEATH removal Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #11827 --- module/os/freebsd/zfs/zfs_file_os.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/module/os/freebsd/zfs/zfs_file_os.c b/module/os/freebsd/zfs/zfs_file_os.c index 06546c12e4..908cff6810 100644 --- a/module/os/freebsd/zfs/zfs_file_os.c +++ b/module/os/freebsd/zfs/zfs_file_os.c @@ -295,14 +295,12 @@ zfs_file_unlink(const char *fnamep) #if __FreeBSD_version >= 1300018 rc = kern_funlinkat(curthread, AT_FDCWD, fnamep, FD_NONE, seg, 0, 0); -#else -#ifdef AT_BENEATH +#elif __FreeBSD_version >= 1202504 || defined(AT_BENEATH) rc = kern_unlinkat(curthread, AT_FDCWD, __DECONST(char *, fnamep), seg, 0, 0); #else rc = kern_unlinkat(curthread, AT_FDCWD, __DECONST(char *, fnamep), seg, 0); -#endif #endif return (SET_ERROR(rc)); }