From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 6 Mar 2018 10:44:43 +0100 Message-Id: <20180306094444.4875-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: [OSS-Tools] [PATCH 1/2] serial: open port with O_NONBLOCK List-Id: Pengutronix Public Open-Source-Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: oss-tools@pengutronix.de 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 --- serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serial.c b/serial.c index 00b817d9c94f..0778fe1d8698 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) { -- 2.16.1