summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-06-12 14:38:28 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-06-12 14:38:28 +0200
commita607471194aab81261c9b67a41a871eb36a42e6e (patch)
tree29eb5775590794a34a16464d4bc03a8620edec95
parente9e757f8f3a1e449fb96e5f0eeb1f84d0c318902 (diff)
osmocon: Do not exit on read return 0pespin/no-exit
-rw-r--r--src/host/osmocon/osmocon.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index 76f6037..e942788 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) {