From 0b9fe282888361044d0478e3d0a03494b1bac85b Mon Sep 17 00:00:00 2001 From: "Ned T. Crigler" Date: Mon, 23 Apr 2007 18:12:31 +0000 Subject: [PATCH] Always assume that stdin is not a terminal when tcgetattr fails, instead of printing an error message. --- main.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/main.c b/main.c index 0064450..72c2a72 100644 --- a/main.c +++ b/main.c @@ -211,17 +211,8 @@ main(int argc, char **argv) /* Save the original terminal settings. */ if (tcgetattr(0, &orig_term) < 0) { - if (errno == ENOTTY) - { - memset(&orig_term, 0, sizeof(struct termios)); - dont_have_tty = 1; - } - else - { - printf("%s: tcgetattr: %s\n", progname, - strerror(errno)); - return 1; - } + memset(&orig_term, 0, sizeof(struct termios)); + dont_have_tty = 1; } if (dont_have_tty && mode != 'n') @@ -230,6 +221,7 @@ main(int argc, char **argv) progname); return 1; } + if (mode == 'a') { if (argc > 0)