0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2025-03-01 10:21:22 +00:00
Lakka-LibreELEC/packages/lakka/retroarch_base/retroarch/patches/retroarch-bluetoothctl--use-two-calls-to-disconnect-remove-device.path
Tomáš Kelemen (vudiq) 9e639d6461 retroarch: add patch to fix removing paired devices
patch PR'd upstream, tested.
2025-02-18 14:46:42 +01:00

22 lines
721 B
SYSTEMD

diff --git a/bluetooth/drivers/bluetoothctl.c b/bluetooth/drivers/bluetoothctl.c
index 20e3919d0e..16d04cc292 100644
--- a/bluetooth/drivers/bluetoothctl.c
+++ b/bluetooth/drivers/bluetoothctl.c
@@ -225,8 +225,14 @@ static bool bluetoothctl_remove_device(void *data, unsigned idx)
string_list_free(list);
snprintf(btctl->command, sizeof(btctl->command), "\
- echo -e \"disconnect %s\\nremove %s\\n\" | bluetoothctl",
- device, device);
+ bluetoothctl -- disconnect %s",
+ device);
+
+ pclose(popen(btctl->command, "r"));
+
+ snprintf(btctl->command, sizeof(btctl->command), "\
+ bluetoothctl -- remove %s",
+ device);
pclose(popen(btctl->command, "r"));