Jim Meyering wrote:
> Bruno Haible <address@hidden> wrote:
>> But my libc's printf() returned -1, signalling failure. coreutils interpreted
>> that as "was empty output, ok". I would have expected an error message and an
>> exit status of 1.
>
> Strange indeed.
> Could it be a bug in printf for failing, yet not setting the
> stream-failure indicator that is checked by close_stdout's ferror?
I would think the stream failure indicator would only be set
on failures related to the actual output. A little googling
also suggests that SUSv3 says that for *printf()
possible reasons for failure which doesn't set the
streams error indicator, are EILSEQ, EINVAL, and ENOMEM.
PƔdraig.