do not ignore write error for any output size
commitb260039d4257fae4594fbf13bc116ed154dec111
authorJim Meyering <meyering@redhat.com>
Sat, 24 Sep 2011 09:22:06 +0000 (24 11:22 +0200)
committerJim Meyering <meyering@redhat.com>
Sat, 24 Sep 2011 09:22:06 +0000 (24 11:22 +0200)
treefe8aab0af4cd059aad1fdd28f835895c416deeef
parente488d29cecd63f466c3a27ce9970715e28c330da
do not ignore write error for any output size

The previous change was incomplete.
While it makes emacs --batch detect the vast majority of stdout
write failures, errors were still ignored whenever the output size is
k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
  $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
      && echo FAIL: ignored write error
  FAIL: ignored write error
  $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
      && echo FAIL: ignored write error
  FAIL: ignored write error
* emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
src/ChangeLog
src/emacs.c