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