summaryrefslogtreecommitdiff
path: root/lib/webrick/server.rb
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
commit3dd924212f0aa5bd3ea3297140e35d7dc6ac5ee2 (patch)
treeb8a59a82e2f5b84a71b4247d1fb2530a555f8806 /lib/webrick/server.rb
parent6d7dc8f7d5e57431bebb9252e2ddf89417bf283f (diff)
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/webrick/server.rb')
-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 0a8e722..9462e6c 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