From d53a06cdba656bc36fe22e4be85d7abf3d81642b Mon Sep 17 00:00:00 2001 From: Daniel Swarbrick Date: Thu, 24 Aug 2023 12:46:49 +0200 Subject: [PATCH] Fix build tags for isRealProc function Only aix, darwin, dragonfly freebsd and linux GOOS have a Type member in their syscall.Statfs_t struct. However, since the isRealProc compares that Type to a magic number (PROC_SUPER_MAGIC, 0x9fa0) which is only relevant to Linux (and possibly FreeBSD with Linux compatibility), adjust build tags accordingly. This drops the previous nostatfs build tag workaround, since the "tamago" GOOS for which it was originally added won't match the updated build tags. Fixes: #554. Signed-off-by: Daniel Swarbrick --- fs_statfs_notype.go | 4 ++-- fs_statfs_type.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs_statfs_notype.go b/fs_statfs_notype.go index 13d74e39..134767d6 100644 --- a/fs_statfs_notype.go +++ b/fs_statfs_notype.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build netbsd || openbsd || solaris || windows || nostatfs -// +build netbsd openbsd solaris windows nostatfs +//go:build !freebsd && !linux +// +build !freebsd,!linux package procfs diff --git a/fs_statfs_type.go b/fs_statfs_type.go index bee15144..80df79c3 100644 --- a/fs_statfs_type.go +++ b/fs_statfs_type.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !netbsd && !openbsd && !solaris && !windows && !nostatfs -// +build !netbsd,!openbsd,!solaris,!windows,!nostatfs +//go:build freebsd || linux +// +build freebsd linux package procfs