#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Fri, 11 Aug 2017 11:53:10 +0200
changeset 22193 023c7585d304
parent 22192 3e27b5e2db40
child 22194 41775bf87e61
#BUGFIX by stefan class: NonPositionableExternalStream changed: #nextPutBytes:from:startingAt: https://expeccoalm.exept.de/D214652 Ignore #errorNotOpen for Stdout and Stderr
NonPositionableExternalStream.st
--- a/NonPositionableExternalStream.st	Fri Aug 11 11:35:38 2017 +0200
+++ b/NonPositionableExternalStream.st	Fri Aug 11 11:53:10 2017 +0200
@@ -912,19 +912,29 @@
 
     offset := initialOffset.
     remaining := initialWriteCount.
+    handle isNil ifTrue:[
+        self errorNotOpen.
+        (self == Stderr or:[self == Stdout]) ifTrue:[
+           "Care for closed stdout and stderr,
+            which happens, if the console is closed while I am running.
+            In this case, we ignore the error."
+            ^ initialWriteCount.
+        ].
+        ^ 0.
+    ].
 
     wasBlocking := self blocking:false.
     [remaining ~~ 0] whileTrue:[
-	|count|
+        |count|
 
-	count := super nextPutBytes:remaining from:buffer startingAt:offset.
+        count := super nextPutBytes:remaining from:buffer startingAt:offset.
 
-	remaining := remaining - count.
-	offset := offset + count.
-	remaining ~~ 0 ifTrue:[
-	    "Transcript showCR:'writeWait'."
-	    self writeWait.
-	].
+        remaining := remaining - count.
+        offset := offset + count.
+        remaining ~~ 0 ifTrue:[
+            "Transcript showCR:'writeWait'."
+            self writeWait.
+        ].
     ].
     wasBlocking ifTrue:[self blocking:true].