- struct timeval tmp_timer;
- tmp_timer.tv_sec = o_wait;
- tmp_timer.tv_usec = 0;
- /* highest possible fd is netfd (3) */
- rr = select(netfd+1, &ding2, NULL, NULL, &tmp_timer);
- } else
- rr = select(netfd+1, &ding2, NULL, NULL, NULL);
+ poll_tmout_ms = INT_MAX;
+ if (o_wait < INT_MAX / 1000)
+ poll_tmout_ms = o_wait * 1000;
+ }
+ rr = poll(pfds, 2, poll_tmout_ms);