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

Diff for /src/usr.bin/tmux/server-client.c between version 1.13 and 1.14

version 1.13, 2009/11/04 21:47:42 version 1.14, 2009/11/04 23:12:43
Line 61 
Line 61 
         c = xcalloc(1, sizeof *c);          c = xcalloc(1, sizeof *c);
         c->references = 0;          c->references = 0;
         imsg_init(&c->ibuf, fd);          imsg_init(&c->ibuf, fd);
           server_update_event(c);
   
         if (gettimeofday(&c->creation_time, NULL) != 0)          if (gettimeofday(&c->creation_time, NULL) != 0)
                 fatal("gettimeofday failed");                  fatal("gettimeofday failed");
Line 150 
Line 151 
         recalculate_sizes();          recalculate_sizes();
 }  }
   
 /* Register clients for poll. */  
 void  
 server_client_prepare(void)  
 {  
         struct client   *c;  
         u_int            i;  
         int              events;  
   
         for (i = 0; i < ARRAY_LENGTH(&clients); i++) {  
                 if ((c = ARRAY_ITEM(&clients, i)) == NULL)  
                         continue;  
   
                 events = 0;  
                 if (!(c->flags & CLIENT_BAD))  
                         events |= EV_READ;  
                 if (c->ibuf.w.queued > 0)  
                         events |= EV_WRITE;  
                 event_del(&c->event);  
                 event_set(&c->event,  
                     c->ibuf.fd, events, server_client_callback, c);  
                 event_add(&c->event, NULL);  
         }  
 }  
   
 /* Process a single client event. */  /* Process a single client event. */
 void  void
 server_client_callback(int fd, short events, void *data)  server_client_callback(int fd, short events, void *data)
Line 196 
Line 173 
                 if (events & EV_READ && server_client_msg_dispatch(c) != 0)                  if (events & EV_READ && server_client_msg_dispatch(c) != 0)
                         goto client_lost;                          goto client_lost;
         }          }
   
           server_update_event(c);
         return;          return;
   
 client_lost:  client_lost:

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