- retval = select(maxd+1, &rfds, NULL, NULL, NULL);
- if (retval < 0) {
- /* Intentionally empty. We arrive here when interrupted by a signal. No action should be taken. */
- } else {
- if (retval > 0) {
- p = first_host_in_list;
- while (p) {
- if (p->socket!=-1 && FD_ISSET(p->socket, &rfds)) read_icmp_data(p);
- p = p->next;
- }
- } else {
- /* TODO: How to handle this error? */
+ int retval;
+ if ((retval = select(max_fd+1, &rfds, NULL, NULL, NULL)) > 0) {
+ assert(first_host_in_list);
+ host = first_host_in_list;
+ while (host) {
+ if (FD_ISSET(host->socket, &rfds)) read_icmp_data(host);
+ host = host->next;