mirror of
https://github.com/restic/restic.git
synced 2025-03-29 07:32:13 +00:00
Fix lock pass by value and handle error from Release().
This commit is contained in:
parent
c617364d15
commit
cfa3c5884d
@ -14,12 +14,15 @@ func uidGidInt(_ *user.User) (uid, gid uint32, err error) {
|
||||
|
||||
// checkProcess will check if the process retaining the lock exists.
|
||||
// Returns true if the process exists.
|
||||
func (l Lock) processExists() bool {
|
||||
func (l *Lock) processExists() bool {
|
||||
proc, err := os.FindProcess(l.PID)
|
||||
if err != nil {
|
||||
debug.Log("error searching for process %d: %v\n", l.PID, err)
|
||||
return false
|
||||
}
|
||||
proc.Release()
|
||||
err = proc.Release()
|
||||
if err != nil {
|
||||
debug.Log("error releasing process %d: %v\n", l.PID, err)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user