by Hello71 · 8y ago · 0 comments
(if you're actually trying it at home, remember that "true" is virtually always a builtin. AFAIK there is no legitimate way to have shell builtin true return non-zero. (overwriting the command doesn't count :P))
Anyway, yeah, there's a commented line mentioning that:
/* Note true(1) will return EXIT_FAILURE in the
edge case where writes fail with GNU specific options. */
atexit (close_stdout);
Makes sense. If you: $ /bin/true --version >& -
it fails because it was not able to write what you asked it to stdout.