diff options
Diffstat (limited to 'vendor/github.com/prometheus/procfs/mountinfo.go')
-rw-r--r-- | vendor/github.com/prometheus/procfs/mountinfo.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vendor/github.com/prometheus/procfs/mountinfo.go b/vendor/github.com/prometheus/procfs/mountinfo.go index 9471136..59f4d50 100644 --- a/vendor/github.com/prometheus/procfs/mountinfo.go +++ b/vendor/github.com/prometheus/procfs/mountinfo.go | |||
@@ -77,7 +77,7 @@ func parseMountInfoString(mountString string) (*MountInfo, error) { | |||
77 | 77 | ||
78 | mountInfo := strings.Split(mountString, " ") | 78 | mountInfo := strings.Split(mountString, " ") |
79 | mountInfoLength := len(mountInfo) | 79 | mountInfoLength := len(mountInfo) |
80 | if mountInfoLength < 11 { | 80 | if mountInfoLength < 10 { |
81 | return nil, fmt.Errorf("couldn't find enough fields in mount string: %s", mountString) | 81 | return nil, fmt.Errorf("couldn't find enough fields in mount string: %s", mountString) |
82 | } | 82 | } |
83 | 83 | ||
@@ -144,7 +144,7 @@ func mountOptionsParseOptionalFields(o []string) (map[string]string, error) { | |||
144 | return optionalFields, nil | 144 | return optionalFields, nil |
145 | } | 145 | } |
146 | 146 | ||
147 | // Parses the mount options, superblock options. | 147 | // mountOptionsParser parses the mount options, superblock options. |
148 | func mountOptionsParser(mountOptions string) map[string]string { | 148 | func mountOptionsParser(mountOptions string) map[string]string { |
149 | opts := make(map[string]string) | 149 | opts := make(map[string]string) |
150 | options := strings.Split(mountOptions, ",") | 150 | options := strings.Split(mountOptions, ",") |
@@ -161,7 +161,7 @@ func mountOptionsParser(mountOptions string) map[string]string { | |||
161 | return opts | 161 | return opts |
162 | } | 162 | } |
163 | 163 | ||
164 | // Retrieves mountinfo information from `/proc/self/mountinfo`. | 164 | // GetMounts retrieves mountinfo information from `/proc/self/mountinfo`. |
165 | func GetMounts() ([]*MountInfo, error) { | 165 | func GetMounts() ([]*MountInfo, error) { |
166 | data, err := util.ReadFileNoStat("/proc/self/mountinfo") | 166 | data, err := util.ReadFileNoStat("/proc/self/mountinfo") |
167 | if err != nil { | 167 | if err != nil { |
@@ -170,7 +170,7 @@ func GetMounts() ([]*MountInfo, error) { | |||
170 | return parseMountInfo(data) | 170 | return parseMountInfo(data) |
171 | } | 171 | } |
172 | 172 | ||
173 | // Retrieves mountinfo information from a processes' `/proc/<pid>/mountinfo`. | 173 | // GetProcMounts retrieves mountinfo information from a processes' `/proc/<pid>/mountinfo`. |
174 | func GetProcMounts(pid int) ([]*MountInfo, error) { | 174 | func GetProcMounts(pid int) ([]*MountInfo, error) { |
175 | data, err := util.ReadFileNoStat(fmt.Sprintf("/proc/%d/mountinfo", pid)) | 175 | data, err := util.ReadFileNoStat(fmt.Sprintf("/proc/%d/mountinfo", pid)) |
176 | if err != nil { | 176 | if err != nil { |