summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-07 19:56:11 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-07 19:56:11 +0000
commit77b1b6875d9ef772625c1529b7f8f8d045039b41 (patch)
treed156397d554aeb0eb166ca2fda5ca73dcb063c50 /lib
parent143e45a7b43fc511f21b32430aad282256103d0c (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_6@16966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/xmlrpc/server.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/xmlrpc/server.rb b/lib/xmlrpc/server.rb
index 59a5869..ca8d3b0 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