host_darwin: Use a named constant for USER_PROCESS.

Matches the host_linux change.
This commit is contained in:
Robin Burchell 2016-02-02 15:23:34 +01:00
parent 3fc7bc1ef7
commit 55cacb4730
1 changed files with 4 additions and 1 deletions

View File

@ -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{