Bump procfs to v0.0.7 (#1538)
Update Prometheus procfs library to the latest release. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
aede04172c
commit
8a4c9c154b
25 changed files with 1595 additions and 171 deletions
23
vendor/github.com/prometheus/procfs/proc.go
generated
vendored
23
vendor/github.com/prometheus/procfs/proc.go
generated
vendored
|
|
@ -22,6 +22,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/prometheus/procfs/internal/fs"
|
||||
"github.com/prometheus/procfs/internal/util"
|
||||
)
|
||||
|
||||
// Proc provides information about a running process.
|
||||
|
|
@ -121,13 +122,7 @@ func (fs FS) AllProcs() (Procs, error) {
|
|||
|
||||
// CmdLine returns the command line of a process.
|
||||
func (p Proc) CmdLine() ([]string, error) {
|
||||
f, err := os.Open(p.path("cmdline"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
data, err := ioutil.ReadAll(f)
|
||||
data, err := util.ReadFileNoStat(p.path("cmdline"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -141,13 +136,7 @@ func (p Proc) CmdLine() ([]string, error) {
|
|||
|
||||
// Comm returns the command name of a process.
|
||||
func (p Proc) Comm() (string, error) {
|
||||
f, err := os.Open(p.path("comm"))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
data, err := ioutil.ReadAll(f)
|
||||
data, err := util.ReadFileNoStat(p.path("comm"))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
@ -252,13 +241,11 @@ func (p Proc) MountStats() ([]*Mount, error) {
|
|||
// It supplies information missing in `/proc/self/mounts` and
|
||||
// fixes various other problems with that file too.
|
||||
func (p Proc) MountInfo() ([]*MountInfo, error) {
|
||||
f, err := os.Open(p.path("mountinfo"))
|
||||
data, err := util.ReadFileNoStat(p.path("mountinfo"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
return parseMountInfo(f)
|
||||
return parseMountInfo(data)
|
||||
}
|
||||
|
||||
func (p Proc) fileDescriptors() ([]string, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue