From a607471194aab81261c9b67a41a871eb36a42e6e Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 12 Jun 2018 14:38:28 +0200 Subject: osmocon: Do not exit on read return 0 Change-Id: Ifedfbc9742792b4f8d7850dc7ce84d5b3dbc0096 --- src/host/osmocon/osmocon.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c index 76f60374..e9427884 100644 --- a/src/host/osmocon/osmocon.c +++ b/src/host/osmocon/osmocon.c @@ -789,8 +789,11 @@ static int handle_buffer(int buf_used_len) } nbytes = read(dnload.serial_fd.fd, bufptr, buf_left); - if (nbytes <= 0) + if (nbytes <= 0) { + fprintf(stderr, "handle_buffer() read(%d) = %d (%s)\n", + buf_left, nbytes, strerror(errno)); return nbytes; + } if (!dnload.expect_hdlc) { printf("got %i bytes from modem, ", nbytes); @@ -1173,8 +1176,6 @@ static int serial_read(struct osmo_fd *fd, unsigned int flags) while ((rc = handle_read()) > 0); break; } - if (rc == 0) - exit(2); } if (flags & BSC_FD_WRITE) { -- cgit v1.2.3