Skip to content

Commit

Permalink
Merge pull request #3 from smortex/master
Browse files Browse the repository at this point in the history
Merge upstream changes localy
  • Loading branch information
aelsabbahy authored Jun 9, 2023
2 parents 953ade4 + de940c5 commit 7b318e6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Process List Library for Go
# Process List Library for Go [![GoDoc](https://godoc.org/github.com/mitchellh/go-ps?status.png)](https://godoc.org/github.com/mitchellh/go-ps)

go-ps is a library for Go that implements OS-specific APIs to list and
manipulate processes in a platform-safe way. The library can find and
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/goss-org/go-ps

go 1.13
2 changes: 1 addition & 1 deletion process_freebsd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build freebsd,amd64
// +build freebsd

package ps

Expand Down
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 7b318e6

Please sign in to comment.