tools: kwboot: Disable tty interbyte timeout
[platform/kernel/u-boot.git] / tools / kwboot.c
index d8b9507..a527c79 100644 (file)
@@ -648,13 +648,14 @@ 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;
+       tio.c_cc[VTIME] = 0;
 
        rc = tcsetattr(fd, TCSANOW, &tio);
        if (rc)