Merge pull request #701 from wcc526/patch-5

Fix unhandled io.EOF error in net.ConnectionsMax
This commit is contained in:
Lomanic 2019-07-09 22:30:16 +02:00 committed by GitHub
commit fd0ebc6e03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
"strconv"
"strings"
"syscall"
"io"
"github.com/shirou/gopsutil/internal/common"
)
@ -653,7 +654,7 @@ func getProcInodesAll(root string, max int) (map[string][]inodeMap, error) {
t, err := getProcInodes(root, pid, max)
if err != nil {
// skip if permission error or no longer exists
if os.IsPermission(err) || os.IsNotExist(err) {
if os.IsPermission(err) || os.IsNotExist(err) || err == io.EOF {
continue
}
return ret, err