14 #include "kdbus-test.h"
15 #include "kdbus-util.h"
16 #include "kdbus-enum.h"
18 wur int kdbus_test_daemon(struct kdbus_test_env *env)
24 /* This test doesn't make any sense in non-interactive mode */
25 if (!kdbus_util_verbose)
28 print("Created connection %llu on bus '%s'\n",
29 (unsigned long long) env->conn->id, env->buspath);
31 ASSERT_ZERO(kdbus_name_acquire(env->conn, "com.example.kdbus-test", NULL));
32 print(" Aquired name: com.example.kdbus-test\n");
34 fds[0].fd = env->conn->fd;
35 fds[1].fd = STDIN_FILENO;
37 print("Monitoring connections:\n");
39 for (count = 0;; count++) {
40 int i, nfds = sizeof(fds) / sizeof(fds[0]);
42 for (i = 0; i < nfds; i++) {
43 fds[i].events = POLLIN | POLLPRI | POLLHUP;
47 ret = poll(fds, nfds, -1);
51 if (fds[0].revents & POLLIN)
52 ASSERT_ZERO(kdbus_msg_recv(env->conn, NULL, NULL));
55 if (fds[1].revents & POLLIN)
59 print("Closing bus connection\n");