shared/shell: don't hook io_hup on non-interactive
PATCH 1/1 shared/shell: don't hook io_hup on non-interactive
When we are in non-interactive mode (data.mode == 1), we should not terminate the mainloop when stdin is disconnected.
For example, in bash, the following command would terminate immediately without any output.
: | btmgmt info
--- src/shared/shell.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
src/shared/shell.c +3 -3
@@ -1277,10 +1277,10 @@ bool bt_shell_attach(int fd) io =io_new (fd); -if (!data.mode) +if (!data.mode) {io_set_read_handler (io, input_read,NULL ,NULL ); - -io_set_disconnect_handler (io, io_hup,NULL ,NULL ); +io_set_disconnect_handler (io, io_hup,NULL ,NULL ); + } data.input = io;
Signature · 1 line
2.27.0.rc0.183.gde8f92d652-goog
Hi Stimim,
Quoted 32 lines · Stimim Chen
When we are in non-interactive mode (data.mode == 1), we should not terminate the mainloop when stdin is disconnected.
For example, in bash, the following command would terminate immediately without any output.
: | btmgmt info
--- src/shared/shell.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)src/shared/shell.c +3
-4@@ -1277,10 +1277,10 @@ bool bt_shell_attach(int fd) io =io_new (fd); -if (!data.mode) +if (!data.mode) {io_set_read_handler (io, input_read,NULL ,NULL ); - -io_set_disconnect_handler (io, io_hup,NULL ,NULL ); +io_set_disconnect_handler (io, io_hup,NULL ,NULL ); + } data.input = io; --
Quoted 1 line
2.27.0.rc0.183.gde8f92d652-goog
Applied, thanks.
Signature · 1 line
Luiz Augusto von Dentz