1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Merged 14070 from trunk.

* lib/xmlrpc/server.rb (XMLRPC::Server#server): Improve signal handling so
  pressing control-c in the controlling terminal or sending SIGTERM stops
  the XML-RPC server.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
jeg2 2007-12-01 16:14:17 +00:00
parent 4b4d87db62
commit 7fd101e86f
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,11 @@
Wed Dec 2 01:12:15 2007 James Edward Gray II <jeg2@ruby-lang.org>
Merged 14070 from trunk.
* lib/xmlrpc/server.rb (XMLRPC::Server#server): Improve signal handling so
pressing control-c in the controlling terminal or sending SIGTERM stops
the XML-RPC server.
Sat Dec 1 15:13:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/resolv.rb: documentation update. backported from 1.9.

View file

@ -639,11 +639,11 @@ class Server < WEBrickServlet
def serve
if RUBY_PLATFORM =~ /mingw|mswin32/
signal = 1
signals = [1]
else
signal = "HUP"
signals = %w[INT TERM HUP]
end
trap(signal) { @server.shutdown }
signals.each { |signal| trap(signal) { @server.shutdown } }
@server.start
end