ExternalStream.st
branchjv
changeset 21285 7770135c2b54
parent 21252 1b7c2d5523d5
parent 21238 3ee68e64910a
child 21286 4be14939730c
--- a/ExternalStream.st	Thu Jan 12 09:42:50 2017 +0000
+++ b/ExternalStream.st	Fri Jan 13 23:33:10 2017 +0000
@@ -2126,14 +2126,15 @@
     OBJ _handle  = __INST(handle);
 
     if (_handle != nil) {
-	if (__INST(handleType) == @symbol(socketHandle)) {
-	    RETURN (_handle);
-	} else if ((__INST(handleType) == nil)
-		     || (__INST(handleType) == @symbol(filePointer))
-		     || (__INST(handleType) == @symbol(socketFilePointer))
-		     || (__INST(handleType) == @symbol(pipeFilePointer))) {
-	    RETURN ( __MKINT(fileno(__FILEVal(_handle))));
-	}
+        if ((__INST(handleType) == @symbol(fileHandle))
+         || (__INST(handleType) == @symbol(socketHandle))) {
+            RETURN (_handle);
+        } else if ((__INST(handleType) == nil)
+                     || (__INST(handleType) == @symbol(filePointer))
+                     || (__INST(handleType) == @symbol(socketFilePointer))
+                     || (__INST(handleType) == @symbol(pipeFilePointer))) {
+            RETURN ( __MKINT(fileno(__FILEVal(_handle))));
+        }
     }
 %}.
     handle isNil ifTrue:[^ self errorNotOpen].
@@ -5627,18 +5628,18 @@
      We know, that error conditions do not block, so return true for errors."
 
     ^ readAhead notNil
-	or:[handle isNil
-	or:[mode == #writeonly
-	or:[OperatingSystem readCheck:self fileDescriptor]]]
+        or:[handle isNil
+        or:[mode == #writeonly
+        or:[OperatingSystem readCheck:self fileHandle]]]
 
     "
      |pipe|
 
      pipe := PipeStream readingFrom:'(sleep 10; echo hello)'.
      pipe canReadWithoutBlocking ifTrue:[
-	 Transcript showCR:'data available'
+         Transcript showCR:'data available'
      ] ifFalse:[
-	 Transcript showCR:'no data available'
+         Transcript showCR:'no data available'
      ].
      pipe close
     "
@@ -5652,8 +5653,8 @@
      We know, that error conditions do not block, so return true for errors."
 
     ^ handle isNil
-	or:[mode == #readonly
-	or:[OperatingSystem writeCheck:self fileDescriptor]]
+        or:[mode == #readonly
+        or:[OperatingSystem writeCheck:self fileHandle]]
 !
 
 gotErrorOrEOF
@@ -5720,7 +5721,7 @@
     mode == #writeonly ifTrue:[
         ^ self errorWriteOnly
     ].
-    available := OperatingSystem numAvailableForReadOn:self fileDescriptor.
+    available := OperatingSystem numAvailableForReadOn:self fileHandle.
     readAhead notNil ifTrue:[
         available := available + 1
     ].
@@ -5745,7 +5746,7 @@
     handle isNil ifTrue:[^ self errorNotOpen].
     mode == #writeonly ifTrue:[^ self errorWriteOnly].
 
-    fd := self fileDescriptor.
+    fd := self fileHandle.
     (OperatingSystem readCheck:fd) ifTrue:[^ false].
 
     "cannot do a readWait (which means possible suspend),
@@ -5791,7 +5792,7 @@
         ^ self errorNotOpen
     ].
 
-    fd := self fileDescriptor.
+    fd := self fileHandle.
     (OperatingSystem readWriteCheck:fd) ifTrue:[^ false].
 
     wasBlocked := OperatingSystem blockInterrupts.
@@ -5829,7 +5830,7 @@
         ^ self errorNotOpen
     ].
 
-    fd := self fileDescriptor.
+    fd := self fileHandle.
     (OperatingSystem writeExceptionCheck:fd) ifTrue:[^ false].
 
     wasBlocked := OperatingSystem blockInterrupts.
@@ -5870,7 +5871,7 @@
         ^ self errorReadOnly
     ].
 
-    fd := self fileDescriptor.
+    fd := self fileHandle.
     (OperatingSystem writeCheck:fd) ifTrue:[^ false].
 
     wasBlocked := OperatingSystem blockInterrupts.