about summary refs log tree commit homepage
path: root/lib/yahns
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns')
-rw-r--r--lib/yahns/config.rb2
-rw-r--r--lib/yahns/daemon.rb1
-rw-r--r--lib/yahns/queue_kqueue.rb6
-rw-r--r--lib/yahns/queue_quitter_pipe.rb1
-rw-r--r--lib/yahns/sigevent_pipe.rb1
-rw-r--r--lib/yahns/socket_helper.rb2
6 files changed, 2 insertions, 11 deletions
diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb
index bcea0d4..e64cb77 100644
--- a/lib/yahns/config.rb
+++ b/lib/yahns/config.rb
@@ -409,7 +409,7 @@ class Yahns::Config # :nodoc:
     if String === val
       # we've already bound working_directory by the time we get here
       val = File.open(File.expand_path(val), "ab")
-      val.close_on_exec = val.sync = true
+      val.sync = true
     else
       rt = [ :puts, :write, :flush ] # match Rack::Lint
       rt.all? { |m| val.respond_to?(m) } or raise ArgumentError,
diff --git a/lib/yahns/daemon.rb b/lib/yahns/daemon.rb
index e3e2d9c..cca2f3a 100644
--- a/lib/yahns/daemon.rb
+++ b/lib/yahns/daemon.rb
@@ -32,7 +32,6 @@ module Yahns::Daemon # :nodoc:
       # We cannot use Yahns::Sigevent (eventfd) here because we need
       # to detect EOF on unexpected death, not just read/write
       rd, wr = IO.pipe
-      rd.close_on_exec = wr.close_on_exec = true
       grandparent = $$
       if fork
         wr.close # grandparent does not write
diff --git a/lib/yahns/queue_kqueue.rb b/lib/yahns/queue_kqueue.rb
index 064cd0e..3c4c51c 100644
--- a/lib/yahns/queue_kqueue.rb
+++ b/lib/yahns/queue_kqueue.rb
@@ -17,12 +17,6 @@ class Yahns::Queue < SleepyPenguin::Kqueue::IO # :nodoc:
 
   ADD_ONESHOT = Ev::ADD | Ev::ONESHOT # private
 
-  def self.new
-    rv = super
-    rv.close_on_exec = true
-    rv
-  end
-
   # for HTTP and HTTPS servers, we rely on the io writing to us, first
   # flags: QEV_RD/QEV_WR (usually QEV_RD)
   def queue_add(io, flags)
diff --git a/lib/yahns/queue_quitter_pipe.rb b/lib/yahns/queue_quitter_pipe.rb
index 789eacd..9a2e494 100644
--- a/lib/yahns/queue_quitter_pipe.rb
+++ b/lib/yahns/queue_quitter_pipe.rb
@@ -7,7 +7,6 @@ class Yahns::QueueQuitter # :nodoc:
   attr_reader :to_io
   def initialize
     @reader, @to_io = IO.pipe
-    @to_io.close_on_exec = true
   end
 
   def yahns_step
diff --git a/lib/yahns/sigevent_pipe.rb b/lib/yahns/sigevent_pipe.rb
index a85fb2a..f630e72 100644
--- a/lib/yahns/sigevent_pipe.rb
+++ b/lib/yahns/sigevent_pipe.rb
@@ -6,7 +6,6 @@ class Yahns::Sigevent # :nodoc:
   attr_reader :to_io
   def initialize
     @to_io, @wr = Kgio::Pipe.new
-    @to_io.close_on_exec = @wr.close_on_exec = true
   end
 
   def kgio_wait_readable(*args)
diff --git a/lib/yahns/socket_helper.rb b/lib/yahns/socket_helper.rb
index 9d4afc0..963c9fa 100644
--- a/lib/yahns/socket_helper.rb
+++ b/lib/yahns/socket_helper.rb
@@ -19,7 +19,7 @@ module Yahns::SocketHelper # :nodoc:
 
   def set_server_sockopt(sock, opt)
     opt = {backlog: 1024}.merge!(opt)
-    sock.close_on_exec = true
+    sock.close_on_exec = true # needed for inherited sockets
 
     TCPSocket === sock and sock.setsockopt(:IPPROTO_TCP, :TCP_NODELAY, 1)
     sock.setsockopt(:SOL_SOCKET, :SO_KEEPALIVE, 1)