lib/loops/daemonize.rb in lipsiadmin-5.1.6 vs lib/loops/daemonize.rb in lipsiadmin-5.1.7

- old
+ new

@@ -1,11 +1,11 @@ module Lipsiadmin module Loops module Daemonize#:nodoc: def self.read_pid(pid_file) - File.open(pid_file) do |f| - f.gets.to_i + File.open(pid_file) do |f| + f.gets.to_i end rescue Errno::ENOENT 0 end @@ -13,11 +13,11 @@ pid = read_pid(pid_file) return false if pid.zero? if defined?(::JRuby) system "kill -0 #{pid} &> /dev/null" return $? == 0 - else + else Process.kill(0, pid) end true rescue Errno::ESRCH, Errno::ECHILD, Errno::EPERM false @@ -64,9 +64,9 @@ Dir.chdir(LOOPS_ROOT) # Make sure we're in the working directory File.umask(0000) # Insure sensible umask return sess_id - end + end end end -end \ No newline at end of file +end