summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed T. Crigler <crigler@users.sourceforge.net>2007-04-23 18:12:31 +0000
committerNed T. Crigler <crigler@users.sourceforge.net>2007-04-23 18:12:31 +0000
commit0b9fe282888361044d0478e3d0a03494b1bac85b (patch)
treef6174b8ec9498c5942a89931ce4eddf06048c3b7
parent99e713801798321133fdd3642f594da5859d481f (diff)
Always assume that stdin is not a terminal when tcgetattr fails, instead of
printing an error message.
-rw-r--r--main.c14
1 files 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)