if (select (FD_SETSIZE, &read_fd_set, &write_fd_set, NULL, NULL) < 0)
if (select (maxfd + 1, &read_fd_set, &write_fd_set, NULL, NULL) < 0)
void handle_requests (void){  client_connection *connection;  fd_set active_read_fd_set;  fd_set active_write_fd_set;  fd_set read_fd_set;  fd_set write_fd_set;  int fd;  /* Initialize the set of active sockets.  */  FD_ZERO (&active_read_fd_set);  FD_ZERO (&active_write_fd_set);  FD_SET (rw_sock, &active_read_fd_set);  FD_SET (ro_sock, &active_read_fd_set);  while (1)    {      /* Block until input arrives on one or more active sockets.  */      read_fd_set = active_read_fd_set;      write_fd_set = active_write_fd_set;      if (select (FD_SETSIZE, &read_fd_set, &write_fd_set, NULL, NULL) < 0)	error (EXIT_FAILURE, errno, _("cannot get input on sockets"));      /* Service all the sockets with input pending.  */      for (fd = 0; fd < FD_SETSIZE; fd++)	{	  if (FD_ISSET (fd, &read_fd_set))	    {	      if (fd == ro_sock || fd == rw_sock)		{		  int access = ((fd == rw_sock) ? (R_OK | W_OK) : R_OK);		  connection = accept_connection (fd, access);		  if (connection == NULL)		    error (0, errno, _("cannot accept connection"));		  FD_SET (connection->sock, &active_read_fd_set);		}	      else		{		  connection = find_connection (fd);		  if (connection == NULL)		    error (EXIT_FAILURE, 0, _("cannot find connection"));		  if (read_data (connection) < 0)		    {		      close_connection (connection);		      FD_CLR (fd, &active_read_fd_set);		      FD_CLR (fd, &active_write_fd_set);		    }		  if (connection->write_ptr > connection->write_base)		      FD_SET (fd, &active_write_fd_set);		}	    }	  if (FD_ISSET (fd, &write_fd_set) &&	      fd != rw_sock && fd != ro_sock)	    {	      connection = find_connection (fd);	      if (connection == NULL)		error (EXIT_FAILURE, 0, _("cannot find connection"));	      if (write_data (connection) < 0)		{		  close_connection (connection);		  FD_CLR (fd, &active_read_fd_set);		  FD_CLR (fd, &active_write_fd_set);		}	      if (connection->write_ptr == connection->write_base)		FD_CLR (fd, &active_write_fd_set);	    }	}    }}