aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-10-23 18:05:58 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-10-23 18:05:58 +0200
commitee320c6d9cd0781233ed599d743b4da94b4424a7 (patch)
treea7099036b3b64449d1bd153f79d776d0aefe6e12
parente206a4de4c700230f3dc9fdaa101c6f4432e1c27 (diff)
downloadbusybox-w32-ee320c6d9cd0781233ed599d743b4da94b4424a7.tar.gz
busybox-w32-ee320c6d9cd0781233ed599d743b4da94b4424a7.tar.bz2
busybox-w32-ee320c6d9cd0781233ed599d743b4da94b4424a7.zip
getty: reset tty attrs on Ctrl-C and Ctrl-D too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--loginutils/getty.c2
-rw-r--r--networking/udhcp/dhcpc.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 3496f0284..32735642b 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -465,6 +465,7 @@ static char *get_logname(void)
465 /* Do not report trivial EINTR/EIO errors */ 465 /* Do not report trivial EINTR/EIO errors */
466 errno = EINTR; /* make read of 0 bytes be silent too */ 466 errno = EINTR; /* make read of 0 bytes be silent too */
467 if (read(STDIN_FILENO, &c, 1) < 1) { 467 if (read(STDIN_FILENO, &c, 1) < 1) {
468 finalize_tty_attrs();
468 if (errno == EINTR || errno == EIO) 469 if (errno == EINTR || errno == EIO)
469 exit(EXIT_SUCCESS); 470 exit(EXIT_SUCCESS);
470 bb_perror_msg_and_die(bb_msg_read_error); 471 bb_perror_msg_and_die(bb_msg_read_error);
@@ -497,6 +498,7 @@ static char *get_logname(void)
497 } 498 }
498 break; 499 break;
499 case CTL('D'): 500 case CTL('D'):
501 finalize_tty_attrs();
500 exit(EXIT_SUCCESS); 502 exit(EXIT_SUCCESS);
501 default: 503 default:
502 if ((unsigned char)c < ' ') { 504 if ((unsigned char)c < ' ') {
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 7cd0b7bcb..3d4c397ff 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -1548,7 +1548,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1548 * 1548 *
1549 * We think that real server IP (one to use in renew/release) 1549 * We think that real server IP (one to use in renew/release)
1550 * is one in Server-ID option. But I am not 100% sure. 1550 * is one in Server-ID option. But I am not 100% sure.
1551 * IP header's src and Gateway-IP (same in this exaqmple) 1551 * IP header's src and Gateway-IP (same in this example)
1552 * might work too. 1552 * might work too.
1553 * "Next server" and router are definitely wrong ones to use, though... 1553 * "Next server" and router are definitely wrong ones to use, though...
1554 */ 1554 */