commit aa683cbd8388e9bd3ae2c961a9fce47d519e2d2f
Author: Jan Klemkow <[email protected]>
AuthorDate: Tue Apr 14 21:23:20 2020 +0200
Commit: Jan Klemkow <[email protected]>
CommitDate: Tue Apr 14 21:23:20 2020 +0200
simplify terminal check
diff --git a/scroll.c b/scroll.c
index e9b267d..a560999 100644
--- a/scroll.c
+++ b/scroll.c
@@ -402,10 +402,8 @@ main(int argc, char *argv[])
TAILQ_INIT(&head);
- if (isatty(STDIN_FILENO) == 0)
- die("stdin it not a tty");
- if (isatty(STDOUT_FILENO) == 0)
- die("stdout it not a tty");
+ if (isatty(STDIN_FILENO) == 0 || isatty(STDOUT_FILENO) == 0)
+ die("parent it not a tty");
/* save terminal settings for resetting after exit */
if (tcgetattr(STDIN_FILENO, &dfl) == -1)