Change in osmocom-bb[master]: trxcon/trx_if.c: print error message if read() call fails

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu May 9 23:53:14 UTC 2019


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13957 )

Change subject: trxcon/trx_if.c: print error message if read() call fails
......................................................................

trxcon/trx_if.c: print error message if read() call fails

Change-Id: If3aaa730c306e703d1d430a8920284aa592c999c
---
M src/host/trxcon/trx_if.c
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 91075f4..e53fab2 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -444,8 +444,10 @@
 	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 @@
 	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 "

-- 
To view, visit https://gerrit.osmocom.org/13957
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If3aaa730c306e703d1d430a8920284aa592c999c
Gerrit-Change-Number: 13957
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190509/ed2b19e1/attachment.htm>


More information about the gerrit-log mailing list