mailarchive of the pengutronix oss-tools mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: oss-tools@pengutronix.de
Subject: [OSS-Tools] [PATCH 1/2] serial: open port with O_NONBLOCK
Date: Tue,  6 Mar 2018 10:44:43 +0100	[thread overview]
Message-ID: <20180306094444.4875-1-u.kleine-koenig@pengutronix.de> (raw)

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>
---
 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

             reply	other threads:[~2018-03-06  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06  9:44 Uwe Kleine-König [this message]
2018-03-06  9:44 ` [OSS-Tools] [PATCH 2/2] Advertise oss-tools@pengutronix.de as address to send patches to Uwe Kleine-König
2018-03-06 10:06 ` [OSS-Tools] [PATCH 1/2] serial: open port with O_NONBLOCK Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180306094444.4875-1-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=oss-tools@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox