diff mbox series

[BlueZ] tools/btmgmt: Fix --index option for non-interactive mode

Message ID 20240709115541.66118-1-arjan@opmeer.net
State New
Headers show
Series [BlueZ] tools/btmgmt: Fix --index option for non-interactive mode | expand

Commit Message

Arjan Opmeer July 9, 2024, 11:55 a.m. UTC
In non-interactive mode the --index option does not work because the
call to mgmt_set_index() is made after bt_shell_attach().
See also https://github.com/bluez/bluez/issues/893

---
 tools/btmgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index 9b7f851bd..436c2bb21 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -51,8 +51,8 @@  int main(int argc, char *argv[])
 		return EXIT_FAILURE;
 	}
 
-	bt_shell_attach(fileno(stdin));
 	mgmt_set_index(index_option);
+	bt_shell_attach(fileno(stdin));
 	status = bt_shell_run();
 
 	mgmt_remove_submenu();