wren-cli icon indicating copy to clipboard operation
wren-cli copied to clipboard

io.Stdout.flush() ignores output errors rather than ensuring output buffers get written

Open guenther-brunthaler opened this issue 4 years ago • 1 comments
trafficstars

The fflush() C API call in stdoutFlush(WrenVM*) should check the return code and throw an exception if it is nonzero.

In particular

$ cat test.wren 
import "io" for Stdout
System.write("Hello, world!\n")
Stdout.flush()

$ wren-cli test.wren > /dev/full ; echo "return code = $?"
return code = 0

There is currently no error message to indicate the output error, nor a failure return code.

guenther-brunthaler avatar Dec 17 '20 03:12 guenther-brunthaler

@guenther-brunthaler Could you test?

joshgoebel avatar Apr 25 '21 20:04 joshgoebel