about summary refs log tree commit homepage
path: root/lib/unicorn.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-04-01 11:28:51 -0700
committerEric Wong <normalperson@yhbt.net>2009-04-01 11:28:51 -0700
commit5c5cff9ab839b32d32f762eedc94ab39acde663c (patch)
treeae362fa8c4f0c1bf003aa03f936865f3241f2a2c /lib/unicorn.rb
parentf1bf2add4bdb0260333ca167c3b9d192c5cc2929 (diff)
downloadunicorn-5c5cff9ab839b32d32f762eedc94ab39acde663c.tar.gz
FD_CLOEXEC is POSIX and we only run on POSIX.  Things will
slowly leak over time if FD_CLOEXEC is not set, so raise
the issue ASAP.
Diffstat (limited to 'lib/unicorn.rb')
-rw-r--r--lib/unicorn.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index cbbb283..3bdbb3a 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -1,4 +1,5 @@
 require 'logger'
+require 'fcntl'
 
 require 'unicorn/socket'
 require 'unicorn/const'
@@ -425,7 +426,7 @@ module Unicorn
       @workers.clear
       @start_ctx.clear
       @start_ctx = @workers = @rd_sig = @wr_sig = nil
-      @listeners.each { |sock| set_cloexec(sock) }
+      @listeners.each { |sock| sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) }
       ENV.delete('UNICORN_FD')
       @after_fork.call(self, worker.nr) if @after_fork
       @request = HttpRequest.new(logger)