From 55cacb47301d653fa76a3e2ec497dc9be8d3e298 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 2 Feb 2016 15:23:34 +0100 Subject: [PATCH] host_darwin: Use a named constant for USER_PROCESS. Matches the host_linux change. --- host/host_darwin.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/host/host_darwin.go b/host/host_darwin.go index 069c6fa..105d064 100644 --- a/host/host_darwin.go +++ b/host/host_darwin.go @@ -17,6 +17,9 @@ import ( "github.com/shirou/gopsutil/internal/common" ) +// from utmpx.h +const USER_PROCESS = 7 + func HostInfo() (*HostInfoStat, error) { ret := &HostInfoStat{ OS: runtime.GOOS, @@ -103,7 +106,7 @@ func Users() ([]UserStat, error) { if err != nil { continue } - if u.Type != 7 { // skip if not USERPROCESS + if u.Type != USER_PROCESS { continue } user := UserStat{