From a8f16c6837b56f1a344e4686d029a9a068f69491 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 13 Aug 2010 13:37:46 -0700 Subject: dev_fd_response: weaken /dev/fd check for compatibility /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. --- lib/rainbows/dev_fd_response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/dev_fd_response.rb') 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 -- cgit v1.2.3-24-ge0c7