diff --git a/go/lsof/lsof.go b/go/lsof/lsof.go index b2103201814e..62b1f8c7b6f9 100644 --- a/go/lsof/lsof.go +++ b/go/lsof/lsof.go @@ -48,10 +48,14 @@ func (e ExecError) Error() string { // MountPoint returns processes using the mountpoint "lsof /dir" func MountPoint(dir string) ([]Process, error) { - // TODO: Fix lsof to not return error on exit status 1 since it isn't - // really any error, only an indication that there was no use of the - // mount. - return run([]string{"-F", "pcuftn", dir}) + processes, err := run([]string{"-F", "pcuftn", dir}) + if err != nil { + if strings.Contains(err.Error(), "exit status 1") { + return processes, nil + } + return nil, err + } + return processes, nil } func fileTypeFromString(s string) FileType {