Change in osmocom-bb[master]: l1l2 interface: use LOGP for socket errors

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Mon Nov 19 09:17:11 UTC 2018


Max has submitted this change and it was merged. ( 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(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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: merged
Gerrit-Change-Id: Id205bcd9bdb7c3e4b96493d50be8381a6fa80ac6
Gerrit-Change-Number: 11814
Gerrit-PatchSet: 2
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181119/b629f0fc/attachment.htm>


More information about the gerrit-log mailing list