From a40bdcaa36627066d29d57187215c84abb28b797 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Tue, 16 Feb 2016 11:34:17 +0100 Subject: [PATCH] Fix compile error on FreeBSD When compiling `20ecedd0b4c983bd7b88f97cd7a21461988a6c12` with GNU make (`gmake`) on FreeBSD 10.2-RELEASE, I get the following error: ``` collector/filesystem_bsd.go:60: non-bool mnt[i].f_flags & MNT_RDONLY (type C.uint64_t) used as if condition Makefile.COMMON:85: recipe for target 'node_exporter' failed gmake: *** [node_exporter] Error 2 ``` This problem is fixed by this patch. --- collector/filesystem_bsd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/filesystem_bsd.go b/collector/filesystem_bsd.go index d7ba5431..ffe916b3 100644 --- a/collector/filesystem_bsd.go +++ b/collector/filesystem_bsd.go @@ -57,7 +57,7 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) { fstype := C.GoString(&mnt[i].f_fstypename[0]) var ro float64 - if mnt[i].f_flags & MNT_RDONLY { + if (mnt[i].f_flags & MNT_RDONLY) != 0 { ro = 1 }