rem: int nd = select(maxfd, &tmp_fds, 0, 0, 0);
add: int nd = select(maxfd, &tmp_fds, 0, 0, tvp);
context: void tcp_forward(const struct ip_addr *listen, const struct ip_addr *source, vector<int> *port_list, vector<host_map*> *map_list, const struct ip_addr *actv_ip, const struct ip_addr *pasv_ip, int uid, int gid){  fd_set fds, tmp_fds, ms_fds;  int fd_set_len = sizeof(fd_set);  int maxfd = 0;  FD_ZERO(&fds);  FD_ZERO(&ms_fds);  iterator<vector<int>,int> it(*port_list);  for (it.start(); it.cont(); it.next()) {    int port = it.get();    int sd = tcp_listen(listen, &port, 3);    if (sd == -1) {      close_sockets(port_list);      return;    }    fdset(sd, &fds, &maxfd); /* Add sd to set for select() */    FD_SET(sd, &ms_fds);     /* Mark sd as mother socket */  }  if (drop_privileges(uid, gid)) {    close_sockets(port_list);    return;  }  int dest_fd[MAX_FD];  for (int fd = 0; fd < MAX_FD; ++fd)    grandchild_pid[fd] = -1;  for (;;) { /* forever */    /*     * Restores tmp_fds from fds.     */    memcpy(&tmp_fds, &fds, fd_set_len);    /*     * Wait for event: connection on mother sockets or data on anything else.     */    DEBUGFD(syslog(LOG_DEBUG, "TCP select(): %d FDs", maxfd));    int nd = select(maxfd, &tmp_fds, 0, 0, 0);    if (nd == -1) {      if (errno != EINTR)	syslog(LOG_ERR, "TCP select() failed: %m");      continue;    }    for (int fd = 0; nd; ++fd)      if (FD_ISSET(fd, &tmp_fds)) {	--nd;	if (FD_ISSET(fd, &ms_fds))	  mother_socket(fd, &fds, dest_fd, &maxfd, map_list, source);	else	  client_socket(fd, &fds, dest_fd, &maxfd, actv_ip, pasv_ip);      }  } /* main loop */}