mirror of https://github.com/mirror/busybox.git
getty: reset tty attrs on Ctrl-C and Ctrl-D too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>1_20_stable
parent
e206a4de4c
commit
ee320c6d9c
|
@ -465,6 +465,7 @@ static char *get_logname(void)
|
||||||
/* Do not report trivial EINTR/EIO errors */
|
/* Do not report trivial EINTR/EIO errors */
|
||||||
errno = EINTR; /* make read of 0 bytes be silent too */
|
errno = EINTR; /* make read of 0 bytes be silent too */
|
||||||
if (read(STDIN_FILENO, &c, 1) < 1) {
|
if (read(STDIN_FILENO, &c, 1) < 1) {
|
||||||
|
finalize_tty_attrs();
|
||||||
if (errno == EINTR || errno == EIO)
|
if (errno == EINTR || errno == EIO)
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
bb_perror_msg_and_die(bb_msg_read_error);
|
bb_perror_msg_and_die(bb_msg_read_error);
|
||||||
|
@ -497,6 +498,7 @@ static char *get_logname(void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CTL('D'):
|
case CTL('D'):
|
||||||
|
finalize_tty_attrs();
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
default:
|
default:
|
||||||
if ((unsigned char)c < ' ') {
|
if ((unsigned char)c < ' ') {
|
||||||
|
|
|
@ -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)
|
* We think that real server IP (one to use in renew/release)
|
||||||
* is one in Server-ID option. But I am not 100% sure.
|
* 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.
|
* might work too.
|
||||||
* "Next server" and router are definitely wrong ones to use, though...
|
* "Next server" and router are definitely wrong ones to use, though...
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue