aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/kwboot.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/kwboot.c b/tools/kwboot.c
index d8b950787be..fc83161d70f 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -648,11 +648,12 @@ kwboot_open_tty(const char *path, int baudrate)
if (fd < 0)
goto out;
- memset(&tio, 0, sizeof(tio));
-
- tio.c_iflag = 0;
- tio.c_cflag = CREAD|CLOCAL|CS8;
+ rc = tcgetattr(fd, &tio);
+ if (rc)
+ goto out;
+ cfmakeraw(&tio);
+ tio.c_cflag |= CREAD|CLOCAL;
tio.c_cc[VMIN] = 1;
tio.c_cc[VTIME] = 10;