diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-07-10 12:20:24 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-07-10 12:20:24 +0000 |
commit | 9473e3217a1fe156cc8e8ca6485c729ebd0c0b27 (patch) | |
tree | e7264ace3b725723bc3b291048b990bcd0674cff /usr.bin/cu | |
parent | 9f8c38c5e41e64e6d61936acc020a2695c585620 (diff) |
Use function to restore termios and add ~X to help.
Diffstat (limited to 'usr.bin/cu')
-rw-r--r-- | usr.bin/cu/command.c | 3 | ||||
-rw-r--r-- | usr.bin/cu/cu.c | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/cu/command.c b/usr.bin/cu/command.c index 91d1c7cce00..d902748efdb 100644 --- a/usr.bin/cu/command.c +++ b/usr.bin/cu/command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: command.c,v 1.8 2012/07/10 11:42:02 nicm Exp $ */ +/* $OpenBSD: command.c,v 1.9 2012/07/10 12:20:23 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott <nicm@openbsd.org> @@ -234,6 +234,7 @@ do_command(char c) "~> send file to remote host\r\n" "~C connect program to remote host\r\n" "~S set speed\r\n" + "~X send file with XMODEM\r\n" "~? get this summary\r\n" ); break; 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); |