Merge pull request #1077 from shirou/feature/1010_port_to_v3

[host][openbsd][v3] Fix wrong OpenBSD user count
pull/1079/head
shirou 4 years ago committed by GitHub
commit 3a48fa3629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -78,7 +78,7 @@ func UsersWithContext(ctx context.Context) ([]UserStat, error) {
var u Utmp
br := bytes.NewReader(b)
err := binary.Read(br, binary.LittleEndian, &u)
if err != nil || u.Time == 0 {
if err != nil || u.Time == 0 || u.Name[0] == 0 {
continue
}
user := UserStat{

Loading…
Cancel
Save