about summary refs log tree commit homepage
path: root/test/server_helper.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-12-08 17:33:51 +0000
committerEric Wong <e@80x24.org>2018-12-08 17:33:51 +0000
commit2ee9353fba7be5443db2ccdc3541586932ccf1f1 (patch)
treed3d39a754353c5078e468a219a289c2170d97614 /test/server_helper.rb
parentdbadf731d06a79cdae7afd23f4c20fb8fbb9c07e (diff)
downloadyahns-2ee9353fba7be5443db2ccdc3541586932ccf1f1.tar.gz
Since we've required Ruby 2.0+ for a while, we can assume
descriptors are created with IO#close_on_exec=true and
avoid bloating our code with calls to it.
Diffstat (limited to 'test/server_helper.rb')
-rw-r--r--test/server_helper.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/server_helper.rb b/test/server_helper.rb
index b794ee6..095cba1 100644
--- a/test/server_helper.rb
+++ b/test/server_helper.rb
@@ -52,9 +52,7 @@ module ServerHelper
   # only use for newly bound sockets
   def get_tcp_client(host, port, tries = 500)
     begin
-      c = TCPSocket.new(host, port)
-      c.close_on_exec = true
-      return c
+      return TCPSocket.new(host, port)
     rescue Errno::ECONNREFUSED
       raise if tries < 0
       tries -= 1