summaryrefslogtreecommitdiffstats
path: root/src/host
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-05-09 04:14:45 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-05-09 23:53:12 +0000
commit4c2d32afe60f949eb1e09f0e3dca8f87d89af106 (patch)
treefbe051ef837b6f85856d74e4dd8dc943ffcdef39 /src/host
parent2d05901cd4286156de14356e27afb213cb0ec711 (diff)
trxcon/trx_if.c: print error message if read() call fails
Diffstat (limited to 'src/host')
-rw-r--r--src/host/trxcon/trx_if.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 91075f44..e53fab27 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -444,8 +444,10 @@ static int trx_ctrl_read_cb(struct osmo_fd *ofd, unsigned int what)
char buf[1500], *p;
len = read(ofd->fd, buf, sizeof(buf) - 1);
- if (len <= 0)
+ if (len <= 0) {
+ LOGP(DTRX, LOGL_ERROR, "read() failed with rc=%d\n", len);
return len;
+ }
buf[len] = '\0';
if (!!strncmp(buf, "RSP ", 4)) {
@@ -551,8 +553,10 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what)
int len;
len = read(ofd->fd, buf, sizeof(buf));
- if (len <= 0)
+ if (len <= 0) {
+ LOGP(DTRXD, LOGL_ERROR, "read() failed with rc=%d\n", len);
return len;
+ }
if (len != 158) {
LOGP(DTRXD, LOGL_ERROR, "Got data message with invalid "