Skip to content

Commit

Permalink
Fix build tags for isRealProc function (prometheus#560)
Browse files Browse the repository at this point in the history
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: prometheus#554.

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
  • Loading branch information
dswarbrick authored and jritter committed Jul 15, 2024
1 parent 5c138b7 commit 3791da7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fs_statfs_notype.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions fs_statfs_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3791da7

Please sign in to comment.