mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
miracle-sinkctl: don't use readline if no stdin
Signed-off-by: Eric Nelson <eric@nelint.com>
This commit is contained in:
parent
c3f6b7f683
commit
fe9a39bee8
1 changed files with 19 additions and 20 deletions
|
@ -317,28 +317,27 @@ int cli_init(sd_bus *bus, const struct cli_cmd *cmds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isatty(fileno(stdin))) {
|
if (isatty(fileno(stdin))) {
|
||||||
r = sd_event_add_io(cli_event,
|
r = sd_event_add_io(cli_event,
|
||||||
&cli_stdin,
|
&cli_stdin,
|
||||||
fileno(stdin),
|
fileno(stdin),
|
||||||
EPOLLHUP | EPOLLERR | EPOLLIN,
|
EPOLLHUP | EPOLLERR | EPOLLIN,
|
||||||
cli_stdin_fn,
|
cli_stdin_fn,
|
||||||
NULL);
|
NULL);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
cli_vERR(r);
|
cli_vERR(r);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
cli_rl = true;
|
||||||
|
|
||||||
cli_rl = true;
|
rl_erase_empty_line = 1;
|
||||||
|
rl_callback_handler_install(NULL, cli_handler_fn);
|
||||||
|
|
||||||
rl_erase_empty_line = 1;
|
rl_set_prompt(CLI_PROMPT);
|
||||||
rl_callback_handler_install(NULL, cli_handler_fn);
|
printf("\r");
|
||||||
|
rl_on_new_line();
|
||||||
rl_set_prompt(CLI_PROMPT);
|
rl_redisplay();
|
||||||
printf("\r");
|
}
|
||||||
rl_on_new_line();
|
|
||||||
rl_redisplay();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue