pespin has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/64/41664/1
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; }