about summary refs log tree commit homepage
path: root/lib/unicorn.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-02-05 17:31:42 +0000
committerEric Wong <e@80x24.org>2015-02-05 17:34:37 +0000
commitbaab2fc0600c284bf5108a9d9b02b774174ded5d (patch)
treee57c8d7ea599960b06666469a40283e01200754e /lib/unicorn.rb
parent682c9ffa365a2cf5439845be6e0e693d352cfe94 (diff)
downloadunicorn-baab2fc0600c284bf5108a9d9b02b774174ded5d.tar.gz
IO#close_on_exec* methods are available since Ruby 1.9.1.  It
allows us to use less bytecode as it requires fewer operands and
avoids constant lookups.
Diffstat (limited to 'lib/unicorn.rb')
-rw-r--r--lib/unicorn.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index 638b846..cfa1656 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -1,5 +1,4 @@
 # -*- encoding: binary -*-
-require 'fcntl'
 require 'etc'
 require 'stringio'
 require 'rack'
@@ -100,7 +99,7 @@ module Unicorn
 
   # remove this when we only support Ruby >= 2.0
   def self.pipe # :nodoc:
-    Kgio::Pipe.new.each { |io| io.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) }
+    Kgio::Pipe.new.each { |io| io.close_on_exec = true }
   end
   # :startdoc:
 end