diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-06-12 14:38:28 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-06-12 14:38:28 +0200 |
commit | a607471194aab81261c9b67a41a871eb36a42e6e (patch) | |
tree | 29eb5775590794a34a16464d4bc03a8620edec95 | |
parent | e9e757f8f3a1e449fb96e5f0eeb1f84d0c318902 (diff) |
osmocon: Do not exit on read return 0pespin/no-exit
Change-Id: Ifedfbc9742792b4f8d7850dc7ce84d5b3dbc0096
-rw-r--r-- | src/host/osmocon/osmocon.c | 7 |
1 files 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) { |