From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: oss-tools@pengutronix.de
Subject: [OSS-Tools] [PATCH microcom 1/2] Handle EOF from port with a better error message
Date: Wed, 4 Jul 2018 18:29:11 +0200 [thread overview]
Message-ID: <20180704162912.13765-1-u.kleine-koenig@pengutronix.de> (raw)
If in the rfc2217 case the socket is closed from the remote end, writing out
"Invalid argument" isn't very helpful.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
.travis.yml | 7 -------
mux.c | 6 ++++--
2 files changed, 4 insertions(+), 9 deletions(-)
delete mode 100644 .travis.yml
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 0723a3a0a433..000000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: c
-compiler: gcc
-dist: trusty
-script:
- - autoreconf -fi
- - ./configure
- - make distcheck
diff --git a/mux.c b/mux.c
index bd36fc73ec6a..341f8803fc50 100644
--- a/mux.c
+++ b/mux.c
@@ -299,8 +299,10 @@ int mux_loop(struct ios_ops *ios)
len = read(ios->fd, buf, BUFSIZE);
if (len < 0)
return -errno;
- if (len == 0)
- return -EINVAL;
+ if (len == 0) {
+ fprintf(stderr, "Got EOF from port\n");
+ return 0;
+ }
handle_receive_buf(ios, buf, len);
}
--
2.18.0
_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de
next reply other threads:[~2018-07-04 16:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-04 16:29 Uwe Kleine-König [this message]
2018-07-04 16:29 ` [OSS-Tools] [PATCH microcom 2/2] fix debug printf about WILL/WONT/DO/DONT Uwe Kleine-König
2018-07-05 7:00 ` [OSS-Tools] [PATCH microcom 1/2] Handle EOF from port with a better error message Michael Olbrich
2018-07-05 7:41 ` 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=20180704162912.13765-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