mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
ipc/server: Allow skipping epoll of stdin via env variable
This commit is contained in:
parent
2f5da783cc
commit
fd9795b4de
|
@ -41,11 +41,20 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include "util/u_debug.h"
|
||||||
|
|
||||||
#ifdef XRT_HAVE_SYSTEMD
|
#ifdef XRT_HAVE_SYSTEMD
|
||||||
#include <systemd/sd-daemon.h>
|
#include <systemd/sd-daemon.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "XRT_NO_STDIN" option disables stdin and prevents monado-service from terminating.
|
||||||
|
* This could be useful for situations where there is no proper or in a non-interactive shell.
|
||||||
|
* Two example scenarios are:
|
||||||
|
* * IDE terminals,
|
||||||
|
* * Some scripting environments where monado-service is spawned in the background
|
||||||
|
*/
|
||||||
|
DEBUG_GET_ONCE_BOOL_OPTION(skip_stdin, "XRT_NO_STDIN", false)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
@ -178,7 +187,7 @@ init_epoll(struct ipc_server_mainloop *ml)
|
||||||
|
|
||||||
struct epoll_event ev = {0};
|
struct epoll_event ev = {0};
|
||||||
|
|
||||||
if (!ml->launched_by_socket) {
|
if (!ml->launched_by_socket && !debug_get_bool_option_skip_stdin()) {
|
||||||
// Can't do this when launched by systemd socket activation by
|
// Can't do this when launched by systemd socket activation by
|
||||||
// default.
|
// default.
|
||||||
// This polls stdin.
|
// This polls stdin.
|
||||||
|
|
Loading…
Reference in a new issue