Skip to content

Commit

Permalink
FreeBSD: Fix 12.2-STABLE after AT_BENEATH MFC
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ryan Moeller authored and behlendorf committed Oct 30, 2020
1 parent ca54e52 commit 48cf7d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/os/freebsd/zfs/zfs_file_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ zfs_file_unlink(const char *fnamep)
rc = kern_funlinkat(curthread, AT_FDCWD, fnamep, FD_NONE, seg, 0, 0);
#else
#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
rc = kern_unlinkat(curthread, AT_FDCWD, __DECONST(char *, fnamep),
seg, 0);
Expand Down

0 comments on commit 48cf7d6

Please sign in to comment.