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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu May 9 21:40:15 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/57/13957/1

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: newchange
Gerrit-Change-Id: If3aaa730c306e703d1d430a8920284aa592c999c
Gerrit-Change-Number: 13957
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190509/0bb8598a/attachment.html>


More information about the gerrit-log mailing list