summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-11 08:03:17 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-11 08:03:17 +0000
commit630e4ef492b5647bae57d00fffa2004b7ececfc8 (patch)
tree151a506d6ab2b356ea6e1fcec9535862129aa8ba
parent3f0d724dc36df47e4b262f5c37f6690c2832277e (diff)
* ext/socket/lib/socket.rb (Socket.unix_server_loop): use
unix_server_socket with a block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/socket/lib/socket.rb7
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index df1fb46..0019542 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Feb 11 17:01:52 2009 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/lib/socket.rb (Socket.unix_server_loop): use
+ unix_server_socket with a block.
+
Wed Feb 11 16:54:26 2009 Tanaka Akira <akr@fsij.org>
* ext/socket/lib/socket.rb (Socket.unix_server_socket): close the
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index adc2814..a207d5a 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -645,10 +645,9 @@ class Socket
# }
#
def self.unix_server_loop(path, &b) # :yield: socket, client_addrinfo
- serv = unix_server_socket(path)
- accept_loop(serv, &b)
- ensure
- serv.close if serv && !serv.closed?
+ unix_server_socket(path) {|serv|
+ accept_loop(serv, &b)
+ }
end
end