diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-11 08:03:17 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-11 08:03:17 +0000 |
commit | 630e4ef492b5647bae57d00fffa2004b7ececfc8 (patch) | |
tree | 151a506d6ab2b356ea6e1fcec9535862129aa8ba /ext/socket/lib/socket.rb | |
parent | 3f0d724dc36df47e4b262f5c37f6690c2832277e (diff) | |
download | ruby-630e4ef492b5647bae57d00fffa2004b7ececfc8.tar.gz |
* 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
Diffstat (limited to 'ext/socket/lib/socket.rb')
-rw-r--r-- | ext/socket/lib/socket.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb index adc28147b3..a207d5afb8 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 |