aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-22 00:16:23 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-22 00:16:23 +0000
commit2de213b6d8ed73647a7750fcaa35d32204b3eb11 (patch)
treeb8a59a82e2f5b84a71b4247d1fb2530a555f8806 /lib
parent73e41f01d1853839653b2c89d56131921a6137b8 (diff)
downloadruby-2de213b6d8ed73647a7750fcaa35d32204b3eb11.tar.gz
webrick/server: simplify Daemon.start
Process.daemon exists since Ruby 1.9.1 and does most of what we need. * lib/webrick/server.rb (Daemon.start): simplify [Misc #12937] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/webrick/server.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb
index 0a8e722b44..9462e6cfb2 100644
--- a/lib/webrick/server.rb
+++ b/lib/webrick/server.rb
@@ -44,14 +44,8 @@ module WEBrick
# block, if given.
def Daemon.start
- exit!(0) if fork
- Process::setsid
- exit!(0) if fork
- Dir::chdir("/")
- File::umask(0)
- STDIN.reopen(IO::NULL)
- STDOUT.reopen(IO::NULL, "w")
- STDERR.reopen(IO::NULL, "w")
+ Process.daemon
+ File.umask(0)
yield if block_given?
end
end