am cced7693: am 5605c10a: am 101c57f7: Merge "Disable CR/LF translation for adb interactive shell."

* commit 'cced7693520d6376fe25fa4698c2b5ec7d6364a0':
  Disable CR/LF translation for adb interactive shell.
This commit is contained in:
Elliott Hughes 2015-04-05 22:45:58 +00:00 committed by Android Git Automerger
commit 08d719d25e

View file

@ -256,29 +256,25 @@ void stdin_raw_restore(int fd);
}
#else
static struct termios tio_save;
static termios g_saved_terminal_state;
static void stdin_raw_init(int fd)
{
struct termios tio;
static void stdin_raw_init(int fd) {
if (tcgetattr(fd, &g_saved_terminal_state)) return;
if(tcgetattr(fd, &tio)) return;
if(tcgetattr(fd, &tio_save)) return;
termios tio;
if (tcgetattr(fd, &tio)) return;
tio.c_lflag = 0; /* disable CANON, ECHO*, etc */
cfmakeraw(&tio);
/* no timeout but request at least one character per read */
// No timeout but request at least one character per read.
tio.c_cc[VTIME] = 0;
tio.c_cc[VMIN] = 1;
tcsetattr(fd, TCSANOW, &tio);
tcflush(fd, TCIFLUSH);
tcsetattr(fd, TCSAFLUSH, &tio);
}
static void stdin_raw_restore(int fd)
{
tcsetattr(fd, TCSANOW, &tio_save);
tcflush(fd, TCIFLUSH);
static void stdin_raw_restore(int fd) {
tcsetattr(fd, TCSAFLUSH, &g_saved_terminal_state);
}
#endif