ExternalStream.st
changeset 12691 b870ce93f973
parent 12688 b429dc21d6b8
child 12696 52b0ce2f44ca
--- 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!