dexter has uploaded this change for review.
e1d: clean up error logging in handle_ts_sign_read
The error logging in handle_ts_sign_read can be organized the same way
as in handle_ts_raw_read, then we do not need to check the return code
twice.
Change-Id: Ife3bb07fb4180dbd73d0efdc5acade8b20e8a5da
---
M src/input/e1d.c
1 file changed, 16 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/37/32337/1
diff --git a/src/input/e1d.c b/src/input/e1d.c
index a42c87d..289e693 100644
--- a/src/input/e1d.c
+++ b/src/input/e1d.c
@@ -64,16 +64,13 @@
return -ENOMEM;
ret = read(bfd->fd, msg->data, TS_SIGN_ALLOC_SIZE - 16);
- if (ret < 0) {
- LOGPITS(e1i_ts, DLMI, LOGL_ERROR, "%s read failed %d (%s)\n", __func__, ret, strerror(errno));
+ if (ret < 1) {
+ LOGPITS(e1i_ts, DLINP, LOGL_ERROR, "%s read error: %d %s\n", __func__, ret,
+ ret < 0 ? strerror(errno) : "bytes read");
return ret;
}
msgb_put(msg, ret);
- if (ret <= 1) {
- LOGPITS(e1i_ts, DLMI, LOGL_ERROR, "%s read failed %d (%s)\n", __func__, ret, strerror(errno));
- return ret;
- }
return e1inp_rx_ts_lapd(e1i_ts, msg);
}
To view, visit change 32337. To unsubscribe, or for help writing mail filters, visit settings.