eval: Report I/O error on stdout
commit8e43729547b57ab15842dab23215336a353b2ded
authorGerrit Pape <pape@smarden.org>
Fri, 7 Sep 2018 08:34:13 +0000 (7 10:34 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 19 Nov 2018 10:59:50 +0000 (19 18:59 +0800)
tree0fcb4d93dce51cd93520c4270eba9b1227bd275a
parentad072645af04c31300c84d2840fcf1a8d48588ec
eval: Report I/O error on stdout

ENOSPC as a result of an echo builting failing gives no diagnostic.
Just as other shells, dash sets $? to 1, but aside from terminating
the script, this does not inform the user what the problem is:

zsh:
    % echo foo > /dev/full
    echo: write error: no space left on device

bash:
    $ echo foo > /dev/full
    bash: echo: write error: No space left on device

dash:
    $ echo foo > /dev/full
    [nothing]

Print an error to stderr like the other shells.

Suggested by Roger Leigh.

Signed-off-by: Gerrit Pape <pape@smarden.org>
[reworded the patch description with information from the bug]
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
Bug-Debian: http://bugs.debian.org/690473
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
src/eval.c