diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-02-09 23:05:23 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-02-11 00:20:13 +0000 |
commit | 3f454ae96e7cc1352f7bf7756a064cf5781154c4 (patch) | |
tree | 0fb3913d71372138f6f71a41a0d326617cc44762 | |
parent | b96d1018ae5261d8ee9344b959acb04c1be43279 (diff) | |
download | cmogstored-3f454ae96e7cc1352f7bf7756a064cf5781154c4.tar.gz |
We don't want to accidentally kill ourselves by targeting PID=0 if the PID file is empty.
-rw-r--r-- | test/upgrade.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/upgrade.rb b/test/upgrade.rb index 643e561..a3e8258 100644 --- a/test/upgrade.rb +++ b/test/upgrade.rb @@ -31,7 +31,7 @@ class TestUpgrade < Test::Unit::TestCase if @pid_path && File.exist?(@pid_path) warn "#@pid_path exists" pid = File.read(@pid_path).to_i rescue 0 - if Process.kill(0, pid) + if pid > 0 && Process.kill(0, pid) warn "Failed to kill #{pid}, Nuking" Process.kill(:KILL, pid) wait_for_death(pid) |