summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 df1fb46aaa2..0019542722f 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 adc28147b38..a207d5afb81 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