1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-02-12 19:21:53 +00:00

Avoid config stdin if not a tty

Allow to run miracle-sinkctl as a service

relates to #98
This commit is contained in:
albfan 2017-04-05 07:51:04 +02:00
parent 04a1ec8aa3
commit b8de12cab3

View file

@ -317,16 +317,18 @@ int cli_init(sd_bus *bus, const struct cli_cmd *cmds)
}
}
r = sd_event_add_io(cli_event,
&cli_stdin,
fileno(stdin),
EPOLLHUP | EPOLLERR | EPOLLIN,
cli_stdin_fn,
NULL);
if (r < 0) {
cli_vERR(r);
goto error;
}
if (isatty(fileno(stdin))) {
r = sd_event_add_io(cli_event,
&cli_stdin,
fileno(stdin),
EPOLLHUP | EPOLLERR | EPOLLIN,
cli_stdin_fn,
NULL);
if (r < 0) {
cli_vERR(r);
goto error;
}
}
cli_rl = true;