Change in osmocom-bb[master]: layer23/sap_interface.c: remove redundant socket_path argument

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/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Wed Dec 26 20:52:22 UTC 2018


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/12433 )

Change subject: layer23/sap_interface.c: remove redundant socket_path argument
......................................................................

layer23/sap_interface.c: remove redundant socket_path argument

Change-Id: I408b3e1fa40e9b5daf88fa6ed5f3930b83dffe6f
---
M src/host/layer23/include/osmocom/bb/common/sap_interface.h
M src/host/layer23/src/common/sap_interface.c
M src/host/layer23/src/mobile/subscriber.c
3 files changed, 6 insertions(+), 5 deletions(-)

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



diff --git a/src/host/layer23/include/osmocom/bb/common/sap_interface.h b/src/host/layer23/include/osmocom/bb/common/sap_interface.h
index e2aad3f..e78320e 100644
--- a/src/host/layer23/include/osmocom/bb/common/sap_interface.h
+++ b/src/host/layer23/include/osmocom/bb/common/sap_interface.h
@@ -2,7 +2,7 @@
 
 typedef int (*osmosap_cb_t)(struct msgb *msg, struct osmocom_ms *ms);
 
-int sap_open(struct osmocom_ms *ms, const char *socket_path);
+int sap_open(struct osmocom_ms *ms);
 int sap_close(struct osmocom_ms *ms);
 int osmosap_send_apdu(struct osmocom_ms *ms, uint8_t *data, uint16_t length);
 int osmosap_register_handler(struct osmocom_ms *ms, osmosap_cb_t cb);
diff --git a/src/host/layer23/src/common/sap_interface.c b/src/host/layer23/src/common/sap_interface.c
index b436c75..7a42233 100644
--- a/src/host/layer23/src/common/sap_interface.c
+++ b/src/host/layer23/src/common/sap_interface.c
@@ -502,14 +502,15 @@
 	return 0;
 }
 
-int sap_open(struct osmocom_ms *ms, const char *socket_path)
+int sap_open(struct osmocom_ms *ms)
 {
 	ssize_t rc;
 
-	rc = osmo_sock_unix_init_ofd(&ms->sap_wq.bfd, SOCK_STREAM, 0, socket_path, OSMO_SOCK_F_CONNECT);
+	rc = osmo_sock_unix_init_ofd(&ms->sap_wq.bfd, SOCK_STREAM, 0,
+		ms->settings.sap_socket_path, OSMO_SOCK_F_CONNECT);
 	if (rc < 0) {
 		LOGP(DSAP, LOGL_ERROR, "Failed to create unix domain socket %s: %s\n",
-		     socket_path, strerror(-rc));
+		     ms->settings.sap_socket_path, strerror(-rc));
 		ms->sap_entity.sap_state = SAP_SOCKET_ERROR;
 		return rc;
 	}
diff --git a/src/host/layer23/src/mobile/subscriber.c b/src/host/layer23/src/mobile/subscriber.c
index 7f24d56..b2be554 100644
--- a/src/host/layer23/src/mobile/subscriber.c
+++ b/src/host/layer23/src/mobile/subscriber.c
@@ -1282,7 +1282,7 @@
 	/* Try to connect to the SAP interface */
 	vty_notify(ms, NULL);
 	vty_notify(ms, "Connecting to the SAP interface...\n");
-	rc = sap_open(ms, ms->settings.sap_socket_path);
+	rc = sap_open(ms);
 	if (rc < 0) {
 		LOGP(DSAP, LOGL_ERROR, "Failed during sap_open(), no SAP based SIM reader\n");
 		vty_notify(ms, "SAP connection error!\n");

-- 
To view, visit https://gerrit.osmocom.org/12433
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: I408b3e1fa40e9b5daf88fa6ed5f3930b83dffe6f
Gerrit-Change-Number: 12433
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Kévin Redon <kredon at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181226/bfb6cdf0/attachment.htm>


More information about the gerrit-log mailing list