changed: #connectTo:withMode:
authorStefan Vogel <sv@exept.de>
Thu, 04 Feb 2010 17:12:32 +0100
changeset 12691 b870ce93f973
parent 12690 1dab7b405304
child 12692 6150a8d7c87e
changed: #connectTo:withMode: set EMFILE, if there are no more stdio fds
ExternalStream.st
--- a/ExternalStream.st	Thu Feb 04 17:11:51 2010 +0100
+++ b/ExternalStream.st	Thu Feb 04 17:12:32 2010 +0100
@@ -4336,6 +4336,10 @@
         else if (__isExternalAddressLike(aFileDescriptor)) {
             fd = _open_osfhandle((long)__externalAddressVal(aFileDescriptor), O_BINARY);
             if (fd < 0) {
+                if (__threadErrno == 0) {
+                    // no more file descriptors
+                    __threadErrno = EMFILE;
+                }
                 error = __mkSmallInteger(__threadErrno);
                 __stxWrapApiLeaveCritical();
                 goto out;
@@ -5679,11 +5683,11 @@
 !ExternalStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.335 2010-02-04 11:47:12 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.336 2010-02-04 16:12:32 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.335 2010-02-04 11:47:12 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.336 2010-02-04 16:12:32 stefan Exp $'
 ! !
 
 ExternalStream initialize!