On 30/08/17 20:41, Pádraig Brady wrote:
>> Looks like solaris doesn't distinguish ENOTTY and EBADF
>> It returns ENOENT in all isatty() failure cases :/
>>
>> I might change things so that tty doesn't distinguish
>> these failure cases on input.
>> I.E. just return 1 for all errors on input
>
> I'm going with the two attached patches to avoid these issues.
Oops, with these doc adjustments on top:
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 5a0c476..eb17462 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -15123,7 +15123,6 @@ Exit status:
1 if standard input is a non-terminal file
2 if given incorrect arguments
3 if a write error occurs
-4 if standard input is closed or its type cannot be determined
@end display
diff --git a/src/tty.c b/src/tty.c
index 5e88c87..c02a0d0 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -17,7 +17,7 @@
/* Displays "not a tty" if stdin is not a terminal.
Displays nothing if -s option is given.
Exit status 0 if stdin is a tty, 1 if not a tty, 2 if usage error,
- 3 if write error, 4 for other stdin errors.
+ 3 if write error.