about summary refs log tree commit homepage
path: root/lib/unicorn
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-02-09 15:28:40 -0800
committerEric Wong <normalperson@yhbt.net>2009-02-09 19:52:21 -0800
commitdb6bf9ca6f2bb3afc1335ff1ff9baa28fab540e5 (patch)
treef3cba16880b19b1ebd1d04736b0092eac17ba3f5 /lib/unicorn
parent101fb9ad1372e97ddf998c7fd677e352719c90e8 (diff)
downloadunicorn-db6bf9ca6f2bb3afc1335ff1ff9baa28fab540e5.tar.gz
We'll be using this flag with a pipe, too.
Diffstat (limited to 'lib/unicorn')
-rw-r--r--lib/unicorn/socket.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/unicorn/socket.rb b/lib/unicorn/socket.rb
index bc09688..cba921f 100644
--- a/lib/unicorn/socket.rb
+++ b/lib/unicorn/socket.rb
@@ -48,6 +48,10 @@ module Unicorn
       sock.setsockopt(SOL_TCP, TCP_CORK, 1) if defined?(TCP_CORK)
     end
 
+    def set_cloexec(io)
+      io.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined?(Fcntl::FD_CLOEXEC)
+    end
+
     def set_server_sockopt(sock)
       if defined?(TCP_DEFER_ACCEPT)
         sock.setsockopt(SOL_TCP, TCP_DEFER_ACCEPT, 1) rescue nil