Skip to contentSkip to conversation

Fix bluetoothctl no output

PATCH Applied Bastien Nocera 3 participants 5 messages Feb 27

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Fix bluetoothctl no output

This fixes a regression in 5.86, and works around a problem specific to btmgmt.

Both commits can be tested independently using the regression test in the meson port:
https://github.com/hadess/bluez/commits/wip/hadess/add-integration-tests/

Bastien Nocera (2):
Revert "shared/shell: Don't init input for non-interactive shells"
tools: Work-around broken stdin handling in home-made mainloop

 Makefile.tools     |  4 ++--
 src/shared/shell.c | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/2 Revert "shared/shell: Don't init input for non-interactive shells"

This reverts commit e73bf582dae60356641a32fc27ae03d359ec4c47.

The fix caused "bluetoothctl list" to not output any text, breaking a lot of existing scripts.

---
 src/shared/shell.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
src/shared/shell.c +5 -5
index 78d58c513d3e..b061f8001414 100644
@@ -1642,13 +1642,13 @@ static bool shell_quit(void *data)
 
 bool bt_shell_attach(int fd)
 {
-	if (data.mode == MODE_INTERACTIVE) {
-		struct input *input;
+	struct input *input;
 
-		input = input_new(fd);
-		if (!input)
-			return false;
+	input = input_new(fd);
+	if (!input)
+		return false;
 
+	if (data.mode == MODE_INTERACTIVE) {
 		io_set_read_handler(input->io, input_read, input, NULL);
 		io_set_disconnect_handler(input->io, input_hup, input, NULL);
 
Signature · 1 line
2.53.0
#2 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1058931

---Test result---

Test Summary:

CheckPatch                    PENDING   0.27 seconds
GitLint                       PENDING   0.35 seconds
BuildEll                      PASS      22.00 seconds
BluezMake                     PASS      738.49 seconds
MakeCheck                     PASS      19.00 seconds
MakeDistcheck                 PASS      264.31 seconds
CheckValgrind                 PASS      309.83 seconds
CheckSmatch                   WARNING   374.42 seconds
bluezmakeextell               PASS      194.64 seconds
IncrementalBuild              PENDING   0.35 seconds
ScanBuild                     PASS      1120.04 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:

---
Regards,
Linux Bluetooth

#3 lore raw

PATCH 2/2 tools: Work-around broken stdin handling in home-made mainloop

In reply to Bastien Nocera

bluetoothd has 3 mainloop implementations, one relying on ell, one relying on glib, and another home-made.

The home-made mainloop handler use epoll() without any fallbacks, and will hang if one tries to epoll() an stdin that redirects from /dev/null.

---
 Makefile.tools | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile.tools +2 -2
index 589f7c94f9df..7c52e053ffee 100644
@@ -531,8 +531,8 @@ tools_obexctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
 
 tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c \
 			client/mgmt.c
-tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \
-				-lreadline
+tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-glib.la \
+				$(GLIB_LIBS) -lreadline
 if DEPRECATED
 noinst_PROGRAMS += attrib/gatttool
 
Signature · 1 line
2.53.0
#4 lore raw
In reply to Bastien Nocera
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 8 lines · On Fri, 27 Feb 2026 12:27:16 +0100 you wrote:

This fixes a regression in 5.86, and works around a problem specific to btmgmt.

Both commits can be tested independently using the regression test in the meson port:
https://github.com/hadess/bluez/commits/wip/hadess/add-integration-tests/

[...]

Here is the summary with links:
- [BlueZ,1/2] Revert "shared/shell: Don't init input for non-interactive shells"

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=b33e923b55e4
  - [BlueZ,2/2] tools: Work-around broken stdin handling in home-made mainloop
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=21e13976f2e3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html