diff options
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/libsystemd-login.sym | 5 | ||||
-rw-r--r-- | src/login/sd-login.c | 9 | ||||
-rw-r--r-- | src/login/test-login.c | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/login/libsystemd-login.sym b/src/login/libsystemd-login.sym index 272b0e2b52..55a828773b 100644 --- a/src/login/libsystemd-login.sym +++ b/src/login/libsystemd-login.sym @@ -58,3 +58,8 @@ LIBSYSTEMD_LOGIN_198 { global: sd_session_get_tty; } LIBSYSTEMD_LOGIN_186; + +LIBSYSTEMD_LOGIN_201 { +global: + sd_login_monitor_get_events; +} LIBSYSTEMD_LOGIN_198; diff --git a/src/login/sd-login.c b/src/login/sd-login.c index 8867e8c8eb..861a57166d 100644 --- a/src/login/sd-login.c +++ b/src/login/sd-login.c @@ -23,6 +23,7 @@ #include <string.h> #include <errno.h> #include <sys/inotify.h> +#include <sys/poll.h> #include "util.h" #include "cgroup-util.h" @@ -797,3 +798,11 @@ _public_ int sd_login_monitor_get_fd(sd_login_monitor *m) { return MONITOR_TO_FD(m); } + +_public_ int sd_login_monitor_get_events(sd_login_monitor *m) { + + if (!m) + return -EINVAL; + + return POLLIN; +} diff --git a/src/login/test-login.c b/src/login/test-login.c index 159ff3efc5..f639129636 100644 --- a/src/login/test-login.c +++ b/src/login/test-login.c @@ -185,7 +185,7 @@ int main(int argc, char* argv[]) { zero(pollfd); pollfd.fd = sd_login_monitor_get_fd(m); - pollfd.events = POLLIN; + pollfd.events = sd_login_monitor_get_events(m); for (n = 0; n < 5; n++) { r = poll(&pollfd, 1, -1); |