laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/37818?usp=email )


Change subject: core/socket.c: Provide more context when printing error message
......................................................................

core/socket.c: Provide more context when printing error message

Let's include the AF, SOCKTYPE and PROTO numbers when logging an error
like "unable to create socket: Address family not supported by protocol"

Change-Id: I91b05d0520b5432ca301cf6fd34468c2f4ac9b72
Related: SYS#7047
---
M src/core/socket.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/37818/1

diff --git a/src/core/socket.c b/src/core/socket.c
index 80a9d0e..97708a7 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -172,8 +172,8 @@

        sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
        if (sfd == -1) {
-               LOGP(DLGLOBAL, LOGL_ERROR,
-                       "unable to create socket: %s\n", strerror(errno));
+               LOGP(DLGLOBAL, LOGL_ERROR, "unable to create socket(%d, %d, 
%d): %s\n",
+                    rp->ai_family, rp->ai_socktype, rp->ai_protocol, 
strerror(errno));
                return sfd;
        }


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

Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I91b05d0520b5432ca301cf6fd34468c2f4ac9b72
Gerrit-Change-Number: 37818
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>

Reply via email to