diff options
| author | Ned T. Crigler <crigler@users.sourceforge.net> | 2007-04-23 18:12:31 +0000 |
|---|---|---|
| committer | Ned T. Crigler <crigler@users.sourceforge.net> | 2007-04-23 18:12:31 +0000 |
| commit | 0b9fe282888361044d0478e3d0a03494b1bac85b (patch) | |
| tree | f6174b8ec9498c5942a89931ce4eddf06048c3b7 | |
| parent | 99e713801798321133fdd3642f594da5859d481f (diff) | |
Always assume that stdin is not a terminal when tcgetattr fails, instead of
printing an error message.
| -rw-r--r-- | main.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -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) |
