summaryrefslogtreecommitdiff
path: root/usr.bin/cu/cu.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-07-10 12:20:24 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-07-10 12:20:24 +0000
commit9473e3217a1fe156cc8e8ca6485c729ebd0c0b27 (patch)
treee7264ace3b725723bc3b291048b990bcd0674cff /usr.bin/cu/cu.c
parent9f8c38c5e41e64e6d61936acc020a2695c585620 (diff)
Use function to restore termios and add ~X to help.
Diffstat (limited to 'usr.bin/cu/cu.c')
-rw-r--r--usr.bin/cu/cu.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/cu/cu.c b/usr.bin/cu/cu.c
index ad06b9ac273..587711dad47 100644
--- a/usr.bin/cu/cu.c
+++ b/usr.bin/cu/cu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cu.c,v 1.4 2012/07/10 10:28:05 nicm Exp $ */
+/* $OpenBSD: cu.c,v 1.5 2012/07/10 12:20:23 nicm Exp $ */
/*
* Copyright (c) 2012 Nicholas Marriott <nicm@openbsd.org>
@@ -163,8 +163,7 @@ getopt:
printf("Connected (speed %u)\r\n", speed);
event_dispatch();
- if (isatty(STDIN_FILENO))
- tcsetattr(STDIN_FILENO, TCSAFLUSH, &saved_tio);
+ restore_termios();
printf("\r\n[EOT]\n");
exit(0);
@@ -173,8 +172,7 @@ getopt:
void
signal_event(int fd, short events, void *data)
{
- if (isatty(STDIN_FILENO))
- tcsetattr(STDIN_FILENO, TCSAFLUSH, &saved_tio);
+ restore_termios();
printf("\r\n[SIG%s]\n", sys_signame[fd]);
exit(0);