* [PATCH BlueZ] mesh: Add clean up on start up failure
@ 2018-09-07 23:25 Inga Stotland
2018-09-11 8:47 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 2+ messages in thread
From: Inga Stotland @ 2018-09-07 23:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Inga Stotland, brian.gix
Call bt_shell_clanup if failed to start the tool.
---
mesh/btmesh.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/mesh/btmesh.c b/mesh/btmesh.c
index 108ec39f3..6a005a978 100644
--- a/mesh/btmesh.c
+++ b/mesh/btmesh.c
@@ -137,8 +137,8 @@ int main(int argc, char *argv[])
bt_shell_set_menu(&main_menu);
if (!index_option) {
- bt_shell_usage();
- return 0;
+ l_info("Controller index is required");
+ goto fail;
}
if (config_option)
@@ -156,8 +156,7 @@ int main(int argc, char *argv[])
mesh = mesh_new(index, config_option);
if (!mesh) {
l_info("Failed to create mesh\n");
- bt_shell_cleanup();
- return EXIT_FAILURE;
+ goto fail;
}
if (save_option)
@@ -172,6 +171,9 @@ int main(int argc, char *argv[])
mesh_unref(mesh);
mesh_cleanup();
l_main_exit();
-
return status;
+
+fail:
+ bt_shell_cleanup();
+ return EXIT_FAILURE;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH BlueZ] mesh: Add clean up on start up failure
2018-09-07 23:25 [PATCH BlueZ] mesh: Add clean up on start up failure Inga Stotland
@ 2018-09-11 8:47 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2018-09-11 8:47 UTC (permalink / raw)
To: Inga Stotland; +Cc: linux-bluetooth, Gix, Brian
Hi Inga,
On Sat, Sep 8, 2018 at 2:25 AM, Inga Stotland <inga.stotland@intel.com> wrote:
> Call bt_shell_clanup if failed to start the tool.
> ---
> mesh/btmesh.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/mesh/btmesh.c b/mesh/btmesh.c
> index 108ec39f3..6a005a978 100644
> --- a/mesh/btmesh.c
> +++ b/mesh/btmesh.c
> @@ -137,8 +137,8 @@ int main(int argc, char *argv[])
> bt_shell_set_menu(&main_menu);
>
> if (!index_option) {
> - bt_shell_usage();
> - return 0;
> + l_info("Controller index is required");
> + goto fail;
> }
>
> if (config_option)
> @@ -156,8 +156,7 @@ int main(int argc, char *argv[])
> mesh = mesh_new(index, config_option);
> if (!mesh) {
> l_info("Failed to create mesh\n");
> - bt_shell_cleanup();
> - return EXIT_FAILURE;
> + goto fail;
> }
>
> if (save_option)
> @@ -172,6 +171,9 @@ int main(int argc, char *argv[])
> mesh_unref(mesh);
> mesh_cleanup();
> l_main_exit();
> -
> return status;
> +
> +fail:
> + bt_shell_cleanup();
> + return EXIT_FAILURE;
> }
> --
> 2.17.1
Applied, thanks.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-11 8:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07 23:25 [PATCH BlueZ] mesh: Add clean up on start up failure Inga Stotland
2018-09-11 8:47 ` Luiz Augusto von Dentz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.