dexter has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32337 )
Change subject: e1d: clean up error logging in handle_ts_sign_read ......................................................................
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(-)
Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved
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); }