diff options
-rw-r--r-- | ext/socket/lib/socket.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb index 35a10de1d0..42c7edddec 100644 --- a/ext/socket/lib/socket.rb +++ b/ext/socket/lib/socket.rb @@ -675,10 +675,10 @@ class Socket < BasicSocket end } rescue Errno::EADDRINUSE - sockets.each {|s| s.close } + sockets.each(&:close) retry rescue Exception - sockets.each {|s| s.close } + sockets.each(&:close) raise end sockets @@ -695,7 +695,7 @@ class Socket < BasicSocket s.listen(Socket::SOMAXCONN) } rescue Exception - sockets.each {|s| s.close } + sockets.each(&:close) raise end sockets @@ -758,7 +758,7 @@ class Socket < BasicSocket raise last_error end rescue Exception - sockets.each {|s| s.close } + sockets.each(&:close) raise end end @@ -766,7 +766,7 @@ class Socket < BasicSocket begin yield sockets ensure - sockets.each {|s| s.close } + sockets.each(&:close) end else sockets @@ -927,7 +927,7 @@ class Socket < BasicSocket begin yield sockets ensure - sockets.each {|s| s.close } if sockets + sockets.each(&:close) if sockets end else sockets |