aboutsummaryrefslogtreecommitdiff
path: root/tools/kwboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/kwboot.c')
-rw-r--r--tools/kwboot.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/kwboot.c b/tools/kwboot.c
index a527c79cf33..5e491f31a43 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -639,7 +639,7 @@ baud_fail:
static int
kwboot_open_tty(const char *path, int baudrate)
{
- int rc, fd;
+ int rc, fd, flags;
struct termios tio;
rc = -1;
@@ -661,6 +661,14 @@ kwboot_open_tty(const char *path, int baudrate)
if (rc)
goto out;
+ flags = fcntl(fd, F_GETFL);
+ if (flags < 0)
+ goto out;
+
+ rc = fcntl(fd, F_SETFL, flags & ~O_NDELAY);
+ if (rc)
+ goto out;
+
rc = kwboot_tty_change_baudrate(fd, baudrate);
if (rc)
goto out;