about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-08-13 13:37:46 -0700
committerEric Wong <normalperson@yhbt.net>2010-08-13 13:37:46 -0700
commita8f16c6837b56f1a344e4686d029a9a068f69491 (patch)
treed4ca0e8b46e5afecf2d2e3d835327bba615f5cd1
parent047365a95fda8765d4339036d41f0cb5f30a1381 (diff)
downloadrainbows-a8f16c6837b56f1a344e4686d029a9a068f69491.tar.gz
/dev/fd/0 may not be stat()-able on some systems after dropping
permissions from root to a regular user.  So just check for
"/dev/fd" which seems to work on RHEL 2.6.18 kernels.  This also
allow us to be used independently of Unicorn in case somebody
ever feels the compelling need to /close/ stdin.
-rw-r--r--lib/rainbows/dev_fd_response.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rainbows/dev_fd_response.rb b/lib/rainbows/dev_fd_response.rb
index d839803..637bcc2 100644
--- a/lib/rainbows/dev_fd_response.rb
+++ b/lib/rainbows/dev_fd_response.rb
@@ -70,7 +70,7 @@ class Rainbows::DevFdResponse < Struct.new(:app)
     end
 
     # remain Rack::Lint-compatible for people with wonky systems :P
-    unless File.exist?("/dev/fd/0")
+    unless File.directory?("/dev/fd")
       alias to_path_orig to_path
       undef_method :to_path
     end