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

Diff for /src/usr.bin/tmux/client.c between version 1.16 and 1.17

version 1.16, 2009/09/02 20:15:49 version 1.17, 2009/09/02 23:49:25
Line 152 
Line 152 
 client_main(struct client_ctx *cctx)  client_main(struct client_ctx *cctx)
 {  {
         struct pollfd    pfd;          struct pollfd    pfd;
         int              nfds;          int              n, nfds;
   
         siginit();          siginit();
   
         logfile("client");          logfile("client");
   
           /*
            * imsg_read in the first client poll loop (before the terminal has
            * been initialiased) may have read messages into the buffer after the
            * MSG_READY switched to here. Process anything outstanding now so poll
            * doesn't hang waiting for messages that have already arrived.
            */
           if (client_msg_dispatch(cctx) != 0)
                   goto out;
   
         for (;;) {          for (;;) {
                 if (sigterm)                  if (sigterm)
                         client_write_server(cctx, MSG_EXITING, NULL, 0);                          client_write_server(cctx, MSG_EXITING, NULL, 0);
Line 190 
Line 199 
                         fatalx("socket error");                          fatalx("socket error");
   
                 if (pfd.revents & POLLIN) {                  if (pfd.revents & POLLIN) {
                           if ((n = imsg_read(&cctx->ibuf)) == -1 || n == 0) {
                                   cctx->exittype = CCTX_DIED;
                                   break;
                           }
                         if (client_msg_dispatch(cctx) != 0)                          if (client_msg_dispatch(cctx) != 0)
                                 break;                                  break;
                 }                  }
Line 201 
Line 214 
                         }                          }
                 }                  }
         }          }
   
   out:
         if (sigterm) {          if (sigterm) {
                 printf("[terminated]\n");                  printf("[terminated]\n");
                 return (1);                  return (1);
Line 251 
Line 265 
         struct imsg              imsg;          struct imsg              imsg;
         struct msg_print_data    printdata;          struct msg_print_data    printdata;
         ssize_t                  n, datalen;          ssize_t                  n, datalen;
   
         if ((n = imsg_read(&cctx->ibuf)) == -1 || n == 0) {  
                 cctx->exittype = CCTX_DIED;  
                 return (-1);  
         }  
   
         for (;;) {          for (;;) {
                 if ((n = imsg_get(&cctx->ibuf, &imsg)) == -1)                  if ((n = imsg_get(&cctx->ibuf, &imsg)) == -1)

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17