chiark / gitweb /
login: add new public API call sd_login_monitor_get_events() to get poll() flags...
[elogind.git] / src / login / test-login.c
index d0916ced6a11a6d1b67b4a72417ea42ad4755d6a..f639129636e68fddc47aeb310ab845b2f69a35e2 100644 (file)
@@ -99,6 +99,14 @@ int main(int argc, char* argv[]) {
         assert_se(r >= 0);
         printf("can do multi session = %s\n", yes_no(r));
 
+        r = sd_seat_can_tty(seat);
+        assert_se(r >= 0);
+        printf("can do tty = %s\n", yes_no(r));
+
+        r = sd_seat_can_graphical(seat);
+        assert_se(r >= 0);
+        printf("can do graphical = %s\n", yes_no(r));
+
         assert_se(sd_uid_get_state(u, &state) >= 0);
         printf("state = %s\n", state);
 
@@ -177,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);