diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-07 19:55:06 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-07 19:55:06 +0000 |
commit | 18da18fcfb0dc3461055528b5311fa852e0bf27d (patch) | |
tree | 01a1ad5a990b00cbc06071aa1fe57617a3240014 /lib | |
parent | b2c93b3dce364e3cd4d256ecda5f2ad03004dcbb (diff) |
merge revision(s) 14071:
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_5@16964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xmlrpc/server.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/xmlrpc/server.rb b/lib/xmlrpc/server.rb index 7900a1d920..5166d7619f 100644 --- a/lib/xmlrpc/server.rb +++ b/lib/xmlrpc/server.rb @@ -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 |