aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-30 22:50:28 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-30 22:55:54 +0200
commitd5be846c920a9f008ba439dad9bc610f7fbd6d89 (patch)
tree291bf711339231df59185b3a79656c2373ce0ef1
parente3e6944cfe2e2f0c71e2697e601e3f657fdba838 (diff)
sctp: Print the rc and the errno in case of an error
Print the errno and RC to give some kind of idea about the error.
-rw-r--r--src/sctp_m2ua.c4
-rw-r--r--src/sctp_m3ua_client.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/sctp_m2ua.c b/src/sctp_m2ua.c
index f1a6219..8f86d49 100644
--- a/src/sctp_m2ua.c
+++ b/src/sctp_m2ua.c
@@ -31,6 +31,7 @@
#include <string.h>
#include <unistd.h>
+#include <errno.h>
#define SCTP_PPID_M2UA 2
@@ -582,7 +583,8 @@ static int m2ua_conn_read(struct osmo_fd *fd)
rc = sctp_recvmsg(fd->fd, msg->data, msg->data_len,
(struct sockaddr *) &addr, &len, &info, NULL);
if (rc <= 0) {
- LOGP(DINP, LOGL_ERROR, "Failed to read.\n");
+ LOGP(DINP, LOGL_ERROR, "Failed to read: %d errno: %d\n",
+ rc, errno);
msgb_free(msg);
m2ua_conn_destroy(fd->data);
return -1;
diff --git a/src/sctp_m3ua_client.c b/src/sctp_m3ua_client.c
index f76a0b0..d4c1777 100644
--- a/src/sctp_m3ua_client.c
+++ b/src/sctp_m3ua_client.c
@@ -29,6 +29,7 @@
#include <netinet/sctp.h>
#include <unistd.h>
+#include <errno.h>
#define SCTP_PPID_M3UA 3
@@ -156,7 +157,8 @@ static int m3ua_conn_read(struct osmo_fd *fd)
rc = sctp_recvmsg(fd->fd, msg->data, msg->data_len,
(struct sockaddr *) &addr, &len, &info, NULL);
if (rc <= 0) {
- LOGP(DINP, LOGL_ERROR, "Failed to read.\n");
+ LOGP(DINP, LOGL_ERROR, "Failed to read: %d errno: %d\n",
+ rc, errno);
msgb_free(msg);
fail_link(link);
return -1;