mirror of
https://github.com/shirou/gopsutil.git
synced 2025-05-02 22:17:08 +08:00
Merge pull request #701 from wcc526/patch-5
Fix unhandled io.EOF error in net.ConnectionsMax
This commit is contained in:
commit
fd0ebc6e03
@ -14,6 +14,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"io"
|
||||||
|
|
||||||
"github.com/shirou/gopsutil/internal/common"
|
"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)
|
t, err := getProcInodes(root, pid, max)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// skip if permission error or no longer exists
|
// 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
|
continue
|
||||||
}
|
}
|
||||||
return ret, err
|
return ret, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user