about summary refs log tree commit homepage
path: root/lib/rainbows.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows.rb')
-rw-r--r--lib/rainbows.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb
index 04d5ebc..2faf3c8 100644
--- a/lib/rainbows.rb
+++ b/lib/rainbows.rb
@@ -30,6 +30,12 @@ module Rainbows
   G = State.new(true, 0, 0, 5)
   O = {}
   class Response416 < RangeError; end
+
+  # map of numeric file descriptors to IO objects to avoid using IO.new
+  # and potentially causing race conditions when using /dev/fd/
+  FD_MAP = {}
+  FD_MAP.compare_by_identity if FD_MAP.respond_to?(:compare_by_identity)
+
   # :startdoc:
 
   require 'rainbows/const'