[BACK]Return to server.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/server.c between version 1.12 and 1.13

version 1.12, 2009/07/20 14:37:51 version 1.13, 2009/07/21 19:54:22
Line 44 
Line 44 
 /* Client list. */  /* Client list. */
 struct clients   clients;  struct clients   clients;
   
   void             server_create_client(int);
 int              server_create_socket(void);  int              server_create_socket(void);
 int              server_main(int);  int              server_main(int);
 void             server_shutdown(void);  void             server_shutdown(void);
Line 52 
Line 53 
 void             server_handle_windows(struct pollfd **);  void             server_handle_windows(struct pollfd **);
 void             server_fill_clients(struct pollfd **);  void             server_fill_clients(struct pollfd **);
 void             server_handle_clients(struct pollfd **);  void             server_handle_clients(struct pollfd **);
 struct client   *server_accept_client(int);  void             server_accept_client(int);
 void             server_handle_client(struct client *);  void             server_handle_client(struct client *);
 void             server_handle_window(struct window *, struct window_pane *);  void             server_handle_window(struct window *, struct window_pane *);
 int              server_check_window_bell(struct session *, struct window *);  int              server_check_window_bell(struct session *, struct window *);
Line 69 
Line 70 
 int              server_update_socket(void);  int              server_update_socket(void);
   
 /* Create a new client. */  /* Create a new client. */
 struct client *  void
 server_create_client(int fd)  server_create_client(int fd)
 {  {
         struct client   *c;          struct client   *c;
Line 107 
Line 108 
         for (i = 0; i < ARRAY_LENGTH(&clients); i++) {          for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
                 if (ARRAY_ITEM(&clients, i) == NULL) {                  if (ARRAY_ITEM(&clients, i) == NULL) {
                         ARRAY_SET(&clients, i, c);                          ARRAY_SET(&clients, i, c);
                         return (c);                          return;
                 }                  }
         }          }
         ARRAY_ADD(&clients, c);          ARRAY_ADD(&clients, c);
         return (c);  
 }  }
   
 /* Find client index. */  /* Find client index. */
Line 735 
Line 735 
 }  }
   
 /* accept(2) and create new client. */  /* accept(2) and create new client. */
 struct client *  void
 server_accept_client(int srv_fd)  server_accept_client(int srv_fd)
 {  {
         struct sockaddr_storage sa;          struct sockaddr_storage sa;
Line 745 
Line 745 
         fd = accept(srv_fd, (struct sockaddr *) &sa, &slen);          fd = accept(srv_fd, (struct sockaddr *) &sa, &slen);
         if (fd == -1) {          if (fd == -1) {
                 if (errno == EAGAIN || errno == EINTR || errno == ECONNABORTED)                  if (errno == EAGAIN || errno == EINTR || errno == ECONNABORTED)
                         return (NULL);                          return;
                 fatal("accept failed");                  fatal("accept failed");
         }          }
         if (sigterm) {          if (sigterm) {
                 close(fd);                  close(fd);
                 return (NULL);                  return;
         }          }
         return (server_create_client(fd));          server_create_client(fd);
 }  }
   
 /* Input data from client. */  /* Input data from client. */

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13