summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-11-16 20:13:10 +0100
committerMax <msuraev@sysmocom.de>2018-11-19 09:17:09 +0000
commitbfa7b3335b5f5f1070d30fd37a7c2750bf7cfe4c (patch)
treed563ed71369090bf7ccb08f3a9e89302bd1e7fe7 /src
parenta4c22ba00d08aeea84c73ecb24e9e453d49103a1 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/host/layer23/src/common/l1l2_interface.c3
-rw-r--r--src/host/layer23/src/common/sap_interface.c3
2 files changed, 4 insertions, 2 deletions
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 @@ int layer2_open(struct osmocom_ms *ms, const char *socket_path)
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 @@ int sap_open(struct osmocom_ms *ms, const char *socket_path)
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;
}