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
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
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;