[macruby-changes] [4773] MacRuby/trunk/ext/socket/socket.c

source_changes at macosforge.org source_changes at macosforge.org
Fri Oct 8 19:02:07 PDT 2010


Revision: 4773
          http://trac.macosforge.org/projects/ruby/changeset/4773
Author:   lsansonetti at apple.com
Date:     2010-10-08 19:02:06 -0700 (Fri, 08 Oct 2010)
Log Message:
-----------
fix a bug in BasicSocket#{listen,setsockopt} where we wouldn't raise an exception in case the stream was already closed

Modified Paths:
--------------
    MacRuby/trunk/ext/socket/socket.c

Modified: MacRuby/trunk/ext/socket/socket.c
===================================================================
--- MacRuby/trunk/ext/socket/socket.c	2010-10-09 01:58:32 UTC (rev 4772)
+++ MacRuby/trunk/ext/socket/socket.c	2010-10-09 02:02:06 UTC (rev 4773)
@@ -407,6 +407,7 @@
     }
 
     GetOpenFile(sock, fptr);
+    rb_io_check_closed(fptr);
     if (setsockopt(fptr->fd, level, option, v, vlen) < 0)
 	rb_sys_fail(fptr->path == 0 ? NULL : RSTRING_PTR(fptr->path));
 
@@ -2668,6 +2669,7 @@
     rb_secure(4);
     backlog = NUM2INT(log);
     GetOpenFile(sock, fptr);
+    rb_io_check_closed(fptr);    
     if (listen(fptr->fd, backlog) < 0)
 	rb_sys_fail("listen(2)");
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101008/03bfd4e7/attachment.html>


More information about the macruby-changes mailing list