#BUGFIX by stefan
class: NonPositionableExternalStream
changed: #nextPutBytes:from:startingAt:
https://expeccoalm.exept.de/D214652
Ignore #errorNotOpen for Stdout and Stderr
--- 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].