--- a/ExternalStream.st Fri Apr 07 16:42:20 2017 +0200
+++ b/ExternalStream.st Fri Apr 07 16:44:06 2017 +0200
@@ -2167,12 +2167,21 @@
|| (__INST(handleType) == @symbol(filePointer))
|| (__INST(handleType) == @symbol(socketFilePointer))
|| (__INST(handleType) == @symbol(pipeFilePointer))) {
- RETURN ( __MKINT(fileno(__FILEVal(_handle))));
+ FILE *file = __FILEVal(_handle);
+ if (file != NULL) {
+ int fileNo = fileno(file);
+
+ if (fileNo >= 0) {
+ RETURN ( __MKINT(fileNo));
+ }
+ }
}
}
%}.
handle isNil ifTrue:[^ self errorNotOpen].
^ self fileDescriptorOfFile:handle
+
+ "Modified: / 07-04-2017 / 16:43:54 / cg"
!
fileDescriptorOfFile:handle