diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2019-05-09 04:14:45 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2019-05-09 23:53:12 +0000 |
commit | 4c2d32afe60f949eb1e09f0e3dca8f87d89af106 (patch) | |
tree | fbe051ef837b6f85856d74e4dd8dc943ffcdef39 | |
parent | 2d05901cd4286156de14356e27afb213cb0ec711 (diff) |
trxcon/trx_if.c: print error message if read() call fails
Change-Id: If3aaa730c306e703d1d430a8920284aa592c999c
-rw-r--r-- | src/host/trxcon/trx_if.c | 8 |
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 " |