>From 9bd06744cd0efbb53bfbe3bffe11b98a6531c83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Wed, 30 Aug 2017 00:55:34 -0700 Subject: [PATCH] tty: treat EINVAL the same as ENOTTY * src/tty.c (main): All systems mention that EINVAL may be returned as well as (the POSIX compliant) ENOTTY. Reported by Assaf Gordon on OpenSolaris 5.10 and 5.11. --- src/tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tty.c b/src/tty.c index e84c353..994b356 100644 --- a/src/tty.c +++ b/src/tty.c @@ -119,7 +119,7 @@ main (int argc, char **argv) if (silent) return (isatty (STDIN_FILENO) ? EXIT_SUCCESS - : errno == ENOTTY ? TTY_STDIN_NOTTY + : (errno == ENOTTY || errno == EINVAL) ? TTY_STDIN_NOTTY : TTY_STDIN_ERROR); int status = EXIT_SUCCESS; @@ -127,7 +127,7 @@ main (int argc, char **argv) if (! tty) { - if (errno != ENOTTY) + if (errno != ENOTTY && errno != EINVAL) error (TTY_STDIN_ERROR, errno, _("standard input")); tty = _("not a tty"); status = TTY_STDIN_NOTTY; -- 2.9.3