pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/41664?usp=email )

Change subject: pcuif: Log errno str if recv() fails
......................................................................

pcuif: Log errno str if recv() fails

Change-Id: Iec5233cfef5301c4bae7d69984e3138d66b6b46d
---
M src/pcuif_sock.c
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  osmith: Looks good to me, approved




diff --git a/src/pcuif_sock.c b/src/pcuif_sock.c
index 15b65ab..08eba23 100644
--- a/src/pcuif_sock.c
+++ b/src/pcuif_sock.c
@@ -120,7 +120,9 @@
        if (rc < 0 && errno == EAGAIN)
                return 0; /* Try again later */
        if (rc <= 0) {
-               LOGP(DL1IF, LOGL_ERROR, "%s: recv() failed with rc=%d 
errno=%d\n", __func__, rc, errno);
+               char errbuf[256];
+               strerror_r(errno, errbuf, sizeof(errbuf));
+               LOGP(DL1IF, LOGL_ERROR, "%s: recv() failed with rc=%d errno=%d 
(%s)\n", __func__, rc, errno, errbuf);
                pcu_sock_close(1);
                return -EIO;
        }

--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/41664?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Iec5233cfef5301c4bae7d69984e3138d66b6b46d
Gerrit-Change-Number: 41664
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to