simplify terminal check - scroll - scrollbackbuffer program for st
(HTM) git clone git://git.suckless.org/scroll
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit aa683cbd8388e9bd3ae2c961a9fce47d519e2d2f
(DIR) parent d1c2d2ad0efb4d029ed130443ea88095e153639e
(HTM) Author: Jan Klemkow <j.klemkow@wemelug.de>
Date: Tue, 14 Apr 2020 21:23:20 +0200
simplify terminal check
Diffstat:
M scroll.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
(DIR) diff --git 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)