Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error out on --eval if stdout write fails (#1444)
Since --eval only has one job - to actually *print* something to stdout, we should fail completely if that's not possible due to an external error, instead of just not printing anything. One particular case is redirecting stdout to a file on a file system that's full (generating the ENOSPC error). In order to be able to detect such errors, we need to flush the stream buffer first; that's because normally, if stdout is not referring to an interactive device (a terminal), it is block-buffered, as opposed to line-buffered.
- Loading branch information