summaryrefslogtreecommitdiff
path: root/ext/socket/lib/socket.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/lib/socket.rb')
-rw-r--r--ext/socket/lib/socket.rb7
1 files changed, 3 insertions, 4 deletions
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