summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/socket/lib/socket.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d3f332..716d763 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 16 19:02:28 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/socket/lib/socket.rb (Socket.tcp_server_sockets_port0): servers
+ is nil if an error occurs before setting it.
+
Thu Jul 16 18:42:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* random.c (fill_random_seed): suppress a warning.
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index b12fc4a..8d41748 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -312,7 +312,7 @@ class Socket
}
sockets
ensure
- sockets.each {|s| s.close if !s.closed? } if $!
+ sockets.each {|s| s.close if !s.closed? } if $! && sockets
end
class << self
private :tcp_server_sockets_port0