Skip to content

Commit

Permalink
* lib/webrick/server.rb: use IO::NULL instead of '/dev/null'
Browse files Browse the repository at this point in the history
* test/ruby/test_string.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
hsbt committed Aug 27, 2015
1 parent a20929c commit 2ded8d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Thu Aug 27 18:05:42 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>

* lib/webrick/server.rb: use IO::NULL instead of '/dev/null'
* test/ruby/test_string.rb: ditto.

Thu Aug 27 15:24:57 2015 Koichi Sasada <ko1@atdot.net>

* compile.c (iseq_set_sequence): rename variable names
Expand Down
6 changes: 3 additions & 3 deletions lib/webrick/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def Daemon.start
exit!(0) if fork
Dir::chdir("/")
File::umask(0)
STDIN.reopen("/dev/null")
STDOUT.reopen("/dev/null", "w")
STDERR.reopen("/dev/null", "w")
STDIN.reopen(IO::NULL)
STDOUT.reopen(IO::NULL, "w")
STDERR.reopen(IO::NULL, "w")
yield if block_given?
end
end
Expand Down
3 changes: 1 addition & 2 deletions test/ruby/test_string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,7 @@ def test_clone
end
end

null = File.exist?("/dev/null") ? "/dev/null" : "NUL" # maybe DOSISH
assert_equal("", File.read(null).clone, '[ruby-dev:32819] reported by Kazuhiro NISHIYAMA')
assert_equal("", File.read(IO::NULL).clone, '[ruby-dev:32819] reported by Kazuhiro NISHIYAMA')
end

def test_concat
Expand Down

0 comments on commit 2ded8d0

Please sign in to comment.