From f409c2588f2c26f786e317a95f0d14effcc22646 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 3 Aug 2026 09:11:04 -0700 Subject: [PATCH] mount: keep the xattr flag constants off freebsd x/sys/unix has no XATTR_CREATE or XATTR_REPLACE there, and weedfs_xattr.go is already tagged away from freebsd for that reason. Putting the constants in a !windows file dragged them back in and broke the freebsd build. --- weed/mount/syscall_shim_unix.go | 9 +-------- weed/mount/weedfs_xattr_flags_unix.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 weed/mount/weedfs_xattr_flags_unix.go diff --git a/weed/mount/syscall_shim_unix.go b/weed/mount/syscall_shim_unix.go index acb5f1d77..d2f4bf4e8 100644 --- a/weed/mount/syscall_shim_unix.go +++ b/weed/mount/syscall_shim_unix.go @@ -2,18 +2,11 @@ package mount -import ( - "syscall" - - sys "golang.org/x/sys/unix" -) +import "syscall" const ( f_RDLCK = syscall.F_RDLCK f_WRLCK = syscall.F_WRLCK f_UNLCK = syscall.F_UNLCK o_ACCMODE = syscall.O_ACCMODE - - xattr_CREATE = sys.XATTR_CREATE - xattr_REPLACE = sys.XATTR_REPLACE ) diff --git a/weed/mount/weedfs_xattr_flags_unix.go b/weed/mount/weedfs_xattr_flags_unix.go new file mode 100644 index 000000000..f8187f6c7 --- /dev/null +++ b/weed/mount/weedfs_xattr_flags_unix.go @@ -0,0 +1,10 @@ +//go:build !windows && !freebsd + +package mount + +import sys "golang.org/x/sys/unix" + +const ( + xattr_CREATE = sys.XATTR_CREATE + xattr_REPLACE = sys.XATTR_REPLACE +)