mailarchive of the pengutronix oss-tools mailing list
 help / color / mirror / Atom feed
* [OSS-Tools] [PATCH microcom 1/2] Handle EOF from port with a better error message
@ 2018-07-04 16:29 Uwe Kleine-König
  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
  0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2018-07-04 16:29 UTC (permalink / raw)
  To: oss-tools

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [OSS-Tools] [PATCH microcom 2/2] fix debug printf about WILL/WONT/DO/DONT
  2018-07-04 16:29 [OSS-Tools] [PATCH microcom 1/2] Handle EOF from port with a better error message Uwe Kleine-König
@ 2018-07-04 16:29 ` 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
  1 sibling, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2018-07-04 16:29 UTC (permalink / raw)
  To: oss-tools

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 mux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mux.c b/mux.c
index 341f8803fc50..c393a4336ad8 100644
--- a/mux.c
+++ b/mux.c
@@ -162,13 +162,13 @@ static int handle_command(unsigned char *buf, int len)
 			dprintf("WILL ");
 			break;
 		case WONT:
-			dprintf("WILL ");
+			dprintf("WONT ");
 			break;
 		case DO:
-			dprintf("WILL ");
+			dprintf("DO ");
 			break;
 		case DONT:
-			dprintf("WILL ");
+			dprintf("DONT ");
 			break;
 		default:
 			dprintf("%d ", buf[i]);
-- 
2.18.0


_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OSS-Tools] [PATCH microcom 1/2] Handle EOF from port with a better error message
  2018-07-04 16:29 [OSS-Tools] [PATCH microcom 1/2] Handle EOF from port with a better error message Uwe Kleine-König
  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 ` Michael Olbrich
  2018-07-05  7:41   ` Uwe Kleine-König
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2018-07-05  7:00 UTC (permalink / raw)
  To: oss-tools

On Wed, Jul 04, 2018 at 06:29:11PM +0200, Uwe Kleine-König wrote:
> 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

I don't think this hunk should be part of this patch.

Michael

> 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

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OSS-Tools] [PATCH microcom 1/2] Handle EOF from port with a better error message
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2018-07-05  7:41 UTC (permalink / raw)
  To: oss-tools

Hallo Michael,

On Thu, Jul 05, 2018 at 09:00:21AM +0200, Michael Olbrich wrote:
> On Wed, Jul 04, 2018 at 06:29:11PM +0200, Uwe Kleine-König wrote:
> > 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
> 
> I don't think this hunk should be part of this patch.

yeah, jlu already pointed that out in a private message.

In the mean time I created a pull request for these two patches on
github (https://github.com/pengutronix/microcom/pull/3) where this hunk
is dropped.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-05  7:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04 16:29 [OSS-Tools] [PATCH microcom 1/2] Handle EOF from port with a better error message Uwe Kleine-König
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox