Commit 55cacb47 authored by Robin Burchell's avatar Robin Burchell

host_darwin: Use a named constant for USER_PROCESS.

Matches the host_linux change.
parent 3fc7bc1e
...@@ -17,6 +17,9 @@ import ( ...@@ -17,6 +17,9 @@ import (
"github.com/shirou/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
// from utmpx.h
const USER_PROCESS = 7
func HostInfo() (*HostInfoStat, error) { func HostInfo() (*HostInfoStat, error) {
ret := &HostInfoStat{ ret := &HostInfoStat{
OS: runtime.GOOS, OS: runtime.GOOS,
...@@ -103,7 +106,7 @@ func Users() ([]UserStat, error) { ...@@ -103,7 +106,7 @@ func Users() ([]UserStat, error) {
if err != nil { if err != nil {
continue continue
} }
if u.Type != 7 { // skip if not USERPROCESS if u.Type != USER_PROCESS {
continue continue
} }
user := UserStat{ user := UserStat{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment