970b8d61a7
This brings in a fix for a cgroups setup race condition that we hit sometimes in the tests. Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
23 lines
530 B
Go
23 lines
530 B
Go
package mount
|
|
|
|
// GetMounts retrieves a list of mounts for the current running process.
|
|
func GetMounts() ([]*Info, error) {
|
|
return parseMountTable()
|
|
}
|
|
|
|
// Mounted looks at /proc/self/mountinfo to determine of the specified
|
|
// mountpoint has been mounted
|
|
func Mounted(mountpoint string) (bool, error) {
|
|
entries, err := parseMountTable()
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
|
|
// Search the table for the mountpoint
|
|
for _, e := range entries {
|
|
if e.Mountpoint == mountpoint {
|
|
return true, nil
|
|
}
|
|
}
|
|
return false, nil
|
|
}
|