summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--file.c2
-rw-r--r--test/ruby/test_rubyoptions.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/file.c b/file.c
index 6aa7dfb720..12299adad6 100644
--- a/file.c
+++ b/file.c
@@ -5959,7 +5959,7 @@ ruby_is_fd_loadable(int fd)
if (S_ISREG(st.st_mode))
return 1;
- if (S_ISFIFO(st.st_mode))
+ if (S_ISFIFO(st.st_mode) || S_ISCHR(st.st_mode))
return -1;
if (S_ISDIR(st.st_mode))
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index ddfd5f1883..e6659d4c30 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -1020,4 +1020,9 @@ class TestRubyOptions < Test::Unit::TestCase
end
end
end
+
+ def test_null_script
+ skip "#{IO::NULL} is not a character device" unless File.chardev?(IO::NULL)
+ assert_in_out_err([IO::NULL], success: true)
+ end
end