[PATCH BlueZ] mesh: Fix mesh to work with MESH_IO_TYPE_UNIT_TEST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes mesh io flow for MESH_IO_TYPE_UNIT_TEST which
got broken after:
commit 9966cb8b6999a5f54fc13acbd7e1526512a84342
("mesh: Add new kernel MGMT based IO transport")
---
 mesh/main.c    | 8 +++++++-
 mesh/mesh-io.c | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/mesh/main.c b/mesh/main.c
index 619b17d88..3bca020a0 100644
--- a/mesh/main.c
+++ b/mesh/main.c
@@ -137,8 +137,14 @@ static void signal_handler(uint32_t signo, void *user_data)
 		return;
 
 	l_info("Terminating");
+
 	mesh_cleanup(true);
-	l_timeout_create(1, kill_to, NULL, NULL);
+
+	if (io_type != MESH_IO_TYPE_UNIT_TEST)
+		l_timeout_create(1, kill_to, NULL, NULL);
+	else
+		l_main_quit();
+
 	terminated = true;
 }
 
diff --git a/mesh/mesh-io.c b/mesh/mesh-io.c
index ae6a82ee4..233f4b328 100644
--- a/mesh/mesh-io.c
+++ b/mesh/mesh-io.c
@@ -151,7 +151,7 @@ struct mesh_io *mesh_io_new(enum mesh_io_type type, void *opts,
 
 	default_io->api = api;
 
-	if (!api->init(default_io, &default_io->favored_index, user_data))
+	if (!api->init(default_io, opts, user_data))
 		goto fail;
 
 	return default_io;
-- 
2.37.3




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux