Max has uploaded this change for review. ( https://gerrit.osmocom.org/11814


Change subject: l1l2 interface: use LOGP for socket errors
......................................................................

l1l2 interface: use LOGP for socket errors

Log via LOGP() like the rest of the file instead of fprintf() for
consistency. While at it, also print error cause.

Change-Id: Id205bcd9bdb7c3e4b96493d50be8381a6fa80ac6
---
M src/host/layer23/src/common/l1l2_interface.c
M src/host/layer23/src/common/sap_interface.c
2 files changed, 4 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/14/11814/1

diff --git a/src/host/layer23/src/common/l1l2_interface.c 
b/src/host/layer23/src/common/l1l2_interface.c
index b366d51..c07b0a1 100644
--- a/src/host/layer23/src/common/l1l2_interface.c
+++ b/src/host/layer23/src/common/l1l2_interface.c
@@ -109,7 +109,8 @@

        rc = osmo_sock_unix_init_ofd(&ms->l2_wq.bfd, SOCK_STREAM, 0, 
socket_path, OSMO_SOCK_F_CONNECT);
        if (rc < 0) {
-               fprintf(stderr, "Failed to create unix domain socket %s\n", 
socket_path);
+               LOGP(DL1C, LOGL_ERROR, "Failed to create unix domain socket %s: 
%s\n",
+                    socket_path, strerror(-rc));
                return rc;
        }

diff --git a/src/host/layer23/src/common/sap_interface.c 
b/src/host/layer23/src/common/sap_interface.c
index cab3c6b..936beb3 100644
--- a/src/host/layer23/src/common/sap_interface.c
+++ b/src/host/layer23/src/common/sap_interface.c
@@ -503,7 +503,8 @@

        rc = osmo_sock_unix_init_ofd(&ms->sap_wq.bfd, SOCK_STREAM, 0, 
socket_path, OSMO_SOCK_F_CONNECT);
        if (rc < 0) {
-               fprintf(stderr, "Failed to create unix domain socket %s\n", 
socket_path);
+               LOGP(DSAP, LOGL_ERROR, "Failed to create unix domain socket %s: 
%s\n",
+                    socket_path, strerror(-rc));
                ms->sap_entity.sap_state = SAP_SOCKET_ERROR;
                return rc;
        }

--
To view, visit https://gerrit.osmocom.org/11814
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: Id205bcd9bdb7c3e4b96493d50be8381a6fa80ac6
Gerrit-Change-Number: 11814
Gerrit-PatchSet: 1
Gerrit-Owner: Max <[email protected]>

Reply via email to