Skip to content

Commit

Permalink
mesh: Fix mesh to work with MESH_IO_TYPE_UNIT_TEST
Browse files Browse the repository at this point in the history
This fixes mesh io flow for MESH_IO_TYPE_UNIT_TEST which
got broken after:
commit 9966cb8
("mesh: Add new kernel MGMT based IO transport")
  • Loading branch information
inga-s authored and bgix committed Oct 5, 2022
1 parent fe94270 commit e71e110
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion mesh/main.c
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion mesh/mesh-io.c
Expand Up @@ -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;
Expand Down

0 comments on commit e71e110

Please sign in to comment.