From d07528148e9cfed8ec6bd96a5d9cefb2d6990eca Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 17 Apr 2023 12:46:01 +0200 Subject: e1d: fix log output When a read access to the osmo-e1d fd fails we just print the error to LOGL_DEBUG but an error like this should be logged to LOGL_ERROR. Also the line might print "read error 0 Success", which is a bit misleading, so let's fix this as well. Change-Id: I3a0500f083cbe8cc162826e2ec974875bafcaba9 --- src/input/e1d.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/input/e1d.c b/src/input/e1d.c index 6392b4f..a42c87d 100644 --- a/src/input/e1d.c +++ b/src/input/e1d.c @@ -164,7 +164,8 @@ handle_ts_trau_read(struct osmo_fd *bfd) ret = read(bfd->fd, msg->data, D_TSX_ALLOC_SIZE); if (ret < 0 || ret != D_TSX_ALLOC_SIZE) { - LOGPITS(e1i_ts, DLINP, LOGL_DEBUG, "read error %d %s\n", ret, strerror(errno)); + LOGPITS(e1i_ts, DLINP, LOGL_ERROR, "%s read error: %d %s\n", __func__, ret, + ret < 0 ? strerror(errno) : "bytes read"); return ret; } @@ -233,7 +234,8 @@ static int handle_ts_raw_read(struct osmo_fd *bfd) ret = read(bfd->fd, msg->data, D_TSX_ALLOC_SIZE); if (ret < 0 || ret != D_TSX_ALLOC_SIZE) { - LOGPITS(e1i_ts, DLINP, LOGL_DEBUG, "read error %d %s\n", ret, strerror(errno)); + LOGPITS(e1i_ts, DLINP, LOGL_ERROR, "%s read error: %d %s\n", __func__, ret, + ret < 0 ? strerror(errno) : "bytes read"); msgb_free(msg); return ret; } -- cgit v1.2.3