summaryrefslogtreecommitdiff
path: root/vendor/github.com/prometheus/procfs/proc_environ.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/prometheus/procfs/proc_environ.go')
-rw-r--r--vendor/github.com/prometheus/procfs/proc_environ.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/vendor/github.com/prometheus/procfs/proc_environ.go b/vendor/github.com/prometheus/procfs/proc_environ.go
index 7172bb586..6134b3580 100644
--- a/vendor/github.com/prometheus/procfs/proc_environ.go
+++ b/vendor/github.com/prometheus/procfs/proc_environ.go
@@ -14,22 +14,16 @@
package procfs
import (
- "io/ioutil"
- "os"
"strings"
+
+ "github.com/prometheus/procfs/internal/util"
)
// Environ reads process environments from /proc/<pid>/environ
func (p Proc) Environ() ([]string, error) {
environments := make([]string, 0)
- f, err := os.Open(p.path("environ"))
- if err != nil {
- return environments, err
- }
- defer f.Close()
-
- data, err := ioutil.ReadAll(f)
+ data, err := util.ReadFileNoStat(p.path("environ"))
if err != nil {
return environments, err
}