host_darwin: Use a named constant for USER_PROCESS.
Matches the host_linux change.
This commit is contained in:
parent
3fc7bc1ef7
commit
55cacb4730
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue