Skip to content

Commit

Permalink
Merge pull request goss-org#1 from gravitational/dmitri/proc-selinux
Browse files Browse the repository at this point in the history
Update process fetcher to support SELinux-enabled systems.
  • Loading branch information
a-palchikov authored Oct 22, 2019
2 parents 621e559 + 79a1272 commit e4db5bf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions process_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,16 @@ func processes() ([]Process, error) {

results := make([]Process, 0, 50)
for {
fis, err := d.Readdir(10)
names, err := d.Readdirnames(10)
if err == io.EOF {
break
}
if err != nil {
return nil, err
}

for _, fi := range fis {
// We only care about directories, since all pids are dirs
if !fi.IsDir() {
continue
}

for _, name := range names {
// We only care if the name starts with a numeric
name := fi.Name()
if name[0] < '0' || name[0] > '9' {
continue
}
Expand Down

0 comments on commit e4db5bf

Please sign in to comment.