summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2018-03-06 10:36:40 +0100
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2018-03-06 10:36:40 +0100
commitfc520340b11ad2646ef080d97eea28c36b4f4581 (patch)
tree87585606351eb681af28f5b02d7445956fbf3f4b
parentf1e2ac47d914152e601c26460f3b37e8721495b9 (diff)
downloadmicrocom-fc520340b11ad2646ef080d97eea28c36b4f4581.tar.gz
microcom-fc520340b11ad2646ef080d97eea28c36b4f4581.tar.xz
serial: open port with O_NONBLOCK
I don't know when this is necessary, but sometimes the pl2303 on an espressobin board blocks on open() otherwise. kermit uses O_NONBLOCK, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--serial.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/serial.c b/serial.c
index 00b817d..0778fe1 100644
--- a/serial.c
+++ b/serial.c
@@ -203,7 +203,7 @@ struct ios_ops * serial_init(char *device)
close(fd);
force:
/* open the device */
- fd = open(device, O_RDWR);
+ fd = open(device, O_RDWR | O_NONBLOCK);
ops->fd = fd;
if (fd < 0) {