- /*
- * Initialize this high as event_add_to_select_args()
- * uses a timeval_min() on this and next_event. Fix
- * from Roel van Meer <rolek@alt001.com>.
- */
- t.tv_sec = 999999;
- t.tv_usec = 0;
-
- event_add_to_select_args(winbind_event_context(),
- &r_fds, &w_fds, &t, &maxfd);
+ pfds->fd = state.sock;
+ pfds->events = POLLIN|POLLHUP;
+ num_pfds = 1;
+
+ timeout = INT_MAX;
+
+ if (!event_add_to_poll_args(
+ winbind_event_context(), talloc_tos(),
+ &pfds, &num_pfds, &timeout)) {
+ DEBUG(1, ("event_add_to_poll_args failed\n"));
+ _exit(1);
+ }