func (l Lockfile) GetOwner() (*os.Process, error) {
	name := string(l)

	// Ok, see, if we have a stale lockfile here
	content, err := ioutil.ReadFile(name)
	if err != nil {
		return nil, err
	}

	// try hard for pids. If no pid, the lockfile is junk anyway and we delete it.
	pid, err := scanPidLine(content)
	if err != nil {
		return nil, err
	}
	running, err := isRunning(pid)
	if err != nil {
		return nil, err
	}

	if running {
		proc, err := os.FindProcess(pid)
		if err != nil {
			return nil, err
		}
		return proc, nil
	}
	return nil, ErrDeadOwner

}
func (l Lockfile) GetOwner() (*os.Process, error) {
	name := string(l)

	
	content, err := ioutil.ReadFile(name)
	if err != nil {
		return nil, err
	}

	
	pid, err := scanPidLine(content)
	if err != nil {
		return nil, err
	}
	running, err := isRunning(pid)
	if err != nil {
		return nil, err
	}

	if running {
		proc, err := os.FindProcess(pid)
		if err != nil {
			return nil, err
		}
		return proc, nil
	}
	return nil, ErrDeadOwner

}
func ( l Lockfile ) GetOwner ( ) ( * os . Process , error ) { name := string ( l ) // Ok, see, if we have a stale lockfile here content , err := ioutil . ReadFile ( name ) if err != nil { return nil , err } // try hard for pids. If no pid, the lockfile is junk anyway and we delete it. pid , err := scanPidLine ( content ) if err != nil { return nil , err } running , err := isRunning ( pid ) if err != nil { return nil , err } if running { proc , err := os . FindProcess ( pid ) if err != nil { return nil , err } return proc , nil } return nil , ErrDeadOwner }
// GetOwner returns who owns the lockfile.
GetOwner returns who owns the lockfile .