1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +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, if (isatty(fileno(stdin))) {
&cli_stdin, r = sd_event_add_io(cli_event,
fileno(stdin), &cli_stdin,
EPOLLHUP | EPOLLERR | EPOLLIN, fileno(stdin),
cli_stdin_fn, EPOLLHUP | EPOLLERR | EPOLLIN,
NULL); cli_stdin_fn,
if (r < 0) { NULL);
cli_vERR(r); if (r < 0) {
goto error; cli_vERR(r);
} goto error;
}
}
cli_rl = true; cli_rl = true;