summaryrefslogtreecommitdiffstats
path: root/lib/puppet/daemon.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/daemon.rb')
-rwxr-xr-xlib/puppet/daemon.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb
index ed06ea6c8..7e2fc7555 100755
--- a/lib/puppet/daemon.rb
+++ b/lib/puppet/daemon.rb
@@ -44,9 +44,7 @@ class Puppet::Daemon
# don't try to start.
def create_pidfile
Puppet::Util.sync(Puppet[:name]).synchronize(Sync::EX) do
- unless Puppet::Util::Pidlock.new(pidfile).lock
- raise "Could not create PID file: #{pidfile}"
- end
+ raise "Could not create PID file: #{pidfile}" unless Puppet::Util::Pidlock.new(pidfile).lock
end
end
@@ -77,9 +75,7 @@ class Puppet::Daemon
def remove_pidfile
Puppet::Util.sync(Puppet[:name]).synchronize(Sync::EX) do
locker = Puppet::Util::Pidlock.new(pidfile)
- if locker.locked?
- locker.unlock or Puppet.err "Could not remove PID file #{pidfile}"
- end
+ locker.unlock or Puppet.err "Could not remove PID file #{pidfile}" if locker.locked?
end
end