void set_dbus_listeners(int *maxfdp, fd_set *rset, fd_set *wset, fd_set *eset) { struct watch *w; for (w = daemon->watches; w; w = w->next) if (dbus_watch_get_enabled(w->watch)) { unsigned int flags = dbus_watch_get_flags(w->watch); #if (DBUS_MINOR > 0) int fd = dbus_watch_get_unix_fd(w->watch); #else int fd = dbus_watch_get_fd(w->watch); #endif bump_maxfd(fd, maxfdp); if (flags & DBUS_WATCH_READABLE) FD_SET(fd, rset); if (flags & DBUS_WATCH_WRITABLE) FD_SET(fd, wset); FD_SET(fd, eset); } }
void set_log_writer(fd_set *set, int *maxfdp) { if (entries && log_fd != -1 && connection_good) { FD_SET(log_fd, set); bump_maxfd(log_fd, maxfdp); } }