unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
						download: 
* [PATCH 0/3] last updates before 5.0 release
@ 2015-11-01  8:37  5% Eric Wong
  2015-11-01  8:37  7% ` [PATCH 1/3] golf down conditional for socket activation Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2015-11-01  8:37 UTC (permalink / raw)
  To: unicorn-public

Nothing significant...

Eric Wong (3):
      golf down conditional for socket activation
      gemspec: relax Ruby version requirement for old RubyGems
      doc updates

 ISSUES                     |  2 +-
 Links                      |  7 ++++---
 lib/unicorn/http_server.rb |  2 +-
 unicorn.gemspec            | 12 ++++++++++--
 4 files changed, 16 insertions(+), 7 deletions(-)


^ permalink raw reply	[relevance 5%]

* [PATCH 1/3] golf down conditional for socket activation
  2015-11-01  8:37  5% [PATCH 0/3] last updates before 5.0 release Eric Wong
@ 2015-11-01  8:37  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-11-01  8:37 UTC (permalink / raw)
  To: unicorn-public; +Cc: Eric Wong

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 $$.
---
 lib/unicorn/http_server.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
-- 
EW


^ permalink raw reply	[relevance 7%]

Results 1-2 of 2 | reverse results
2015-11-01  8:37  5% [PATCH 0/3] last updates before 5.0 release Eric Wong
2015-11-01  8:37  7% ` [PATCH 1/3] golf down conditional for socket activation Eric Wong


unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://yhbt.net/unicorn-public
	git clone --mirror http://ou63pmih66umazou.onion/unicorn-public

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.unicorn

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git