- open with happier mode (create if not exist, open readwrite)

This commit is contained in:
Jordan Sissel 2009-10-20 21:53:29 +00:00
parent f3ba581fcb
commit 9ad4e04f89

View file

@ -57,7 +57,7 @@ def main(args)
pidfile = nil
if options[:pidfile]
pidfile = File.open(options[:pidfile], "w+")
pidfile = File.open(options[:pidfile], IO::RDWR | IO::CREAT)
gotlock = pidfile.flock(File::LOCK_EX | File::LOCK_NB)
if !gotlock
owner = pidfile.read()