summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-11-01 08:09:51 +0000
committerEric Wong <e@80x24.org>2015-11-01 08:17:53 +0000
commitb302eb1beaef181ef48e9360c48ed85a3d87aa01 (patch)
tree4006073ff208a1780c09e8c31708ebabc2296617
parent1f88b6e723fff2302c13f95177cc7253da8b57d6 (diff)
The PID of a process can never be zero as kill(2) interprets a '0'
PID arg as "every process in caller's process group", so there's no
risk of the  'nil.to_i => 0'  conversion resulting in a truth value
when compared to $$.
-rw-r--r--lib/unicorn/http_server.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index c1a2e60..ca56ed3 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -770,7 +770,7 @@ class Unicorn::HttpServer
 
     # emulate sd_listen_fds() for systemd
     sd_pid, sd_fds = ENV.values_at('LISTEN_PID', 'LISTEN_FDS')
-    if sd_pid && sd_pid.to_i == $$
+    if sd_pid.to_i == $$ # n.b. $$ can never be zero
       # 3 = SD_LISTEN_FDS_START
       inherited.concat((3...(3 + sd_fds.to_i)).to_a)
     end