FreeBSD: Fix 12.2-STABLE after AT_BENEATH MFC

AT_BENEATH was merged to stable/12, where kern_unlinkat takes a
non-const path.  DECONST the path passed to kern_unlinkat in the
case where AT_BENEATH is defined.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11139
This commit is contained in:
Ryan Moeller 2020-10-30 18:19:02 -04:00 committed by Brian Behlendorf
parent ca54e52122
commit 48cf7d674a
1 changed files with 2 additions and 1 deletions

View File

@ -296,7 +296,8 @@ zfs_file_unlink(const char *fnamep)
rc = kern_funlinkat(curthread, AT_FDCWD, fnamep, FD_NONE, seg, 0, 0); rc = kern_funlinkat(curthread, AT_FDCWD, fnamep, FD_NONE, seg, 0, 0);
#else #else
#ifdef AT_BENEATH #ifdef AT_BENEATH
rc = kern_unlinkat(curthread, AT_FDCWD, fnamep, seg, 0, 0); rc = kern_unlinkat(curthread, AT_FDCWD, __DECONST(char *, fnamep),
seg, 0, 0);
#else #else
rc = kern_unlinkat(curthread, AT_FDCWD, __DECONST(char *, fnamep), rc = kern_unlinkat(curthread, AT_FDCWD, __DECONST(char *, fnamep),
seg, 0); seg, 0);