lib/puppet/util/pidlock.rb in puppet-2.7.3 vs lib/puppet/util/pidlock.rb in puppet-2.7.4
- old
+ new
@@ -57,12 +57,16 @@
end
def clear_if_stale
return if lock_pid.nil?
+ errors = [Errno::ESRCH]
+ # Process::Error can only happen, and is only defined, on Windows
+ errors << Process::Error if defined? Process::Error
+
begin
Process.kill(0, lock_pid)
- rescue Errno::ESRCH
+ rescue *errors
File.unlink(@lockfile)
end
end
end