getty: reset tty attrs on Ctrl-C and Ctrl-D too
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 23 Oct 2011 16:05:58 +0000 (18:05 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 23 Oct 2011 16:05:58 +0000 (18:05 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
loginutils/getty.c
networking/udhcp/dhcpc.c

index 3496f0284c3a466f38618b91cb273641404f7b07..32735642b3bbb876fbb69532e121d59d3f6d591d 100644 (file)
@@ -465,6 +465,7 @@ static char *get_logname(void)
                        /* Do not report trivial EINTR/EIO errors */
                        errno = EINTR; /* make read of 0 bytes be silent too */
                        if (read(STDIN_FILENO, &c, 1) < 1) {
+                               finalize_tty_attrs();
                                if (errno == EINTR || errno == EIO)
                                        exit(EXIT_SUCCESS);
                                bb_perror_msg_and_die(bb_msg_read_error);
@@ -497,6 +498,7 @@ static char *get_logname(void)
                                }
                                break;
                        case CTL('D'):
+                               finalize_tty_attrs();
                                exit(EXIT_SUCCESS);
                        default:
                                if ((unsigned char)c < ' ') {
index 7cd0b7bcb65bb757374e2446c38f2f1fb827a35e..3d4c397ffd9ad784852ccf1ef5fe59ab8872d62e 100644 (file)
@@ -1548,7 +1548,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
  *
  * We think that real server IP (one to use in renew/release)
  * is one in Server-ID option. But I am not 100% sure.
- * IP header's src and Gateway-IP (same in this exaqmple)
+ * IP header's src and Gateway-IP (same in this example)
  * might work too.
  * "Next server" and router are definitely wrong ones to use, though...
  */