[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.350 and 1.351

version 1.350, 2020/05/24 14:45:00 version 1.351, 2020/05/26 08:41:47
Line 223 
Line 223 
         c->environ = environ_create();          c->environ = environ_create();
   
         c->fd = -1;          c->fd = -1;
         c->cwd = NULL;          c->out_fd = -1;
   
         c->queue = cmdq_new();          c->queue = cmdq_new();
         RB_INIT(&c->windows);          RB_INIT(&c->windows);
Line 338 
Line 338 
         proc_remove_peer(c->peer);          proc_remove_peer(c->peer);
         c->peer = NULL;          c->peer = NULL;
   
           if (c->out_fd != -1)
                   close(c->out_fd);
         if (c->fd != -1) {          if (c->fd != -1) {
                 close(c->fd);                  close(c->fd);
                 c->fd = -1;                  c->fd = -1;
Line 1573 
Line 1575 
 out:  out:
         /*          /*
          * If there is data remaining, and there are no clients able to consume           * If there is data remaining, and there are no clients able to consume
          * it, do not read any more. This is true when 1) there are attached           * it, do not read any more. This is true when there are attached
          * clients 2) all the clients are control clients 3) all of them have           * clients, all of which are control clients which are not able to
          * either the OFF flag set, or are otherwise not able to accept any           * accept any more data.
          * more data for this pane.  
          */           */
         if (off)          if (off)
                 bufferevent_disable(wp->event, EV_READ);                  bufferevent_disable(wp->event, EV_READ);
Line 1969 
Line 1970 
         case MSG_IDENTIFY_TTYNAME:          case MSG_IDENTIFY_TTYNAME:
         case MSG_IDENTIFY_CWD:          case MSG_IDENTIFY_CWD:
         case MSG_IDENTIFY_STDIN:          case MSG_IDENTIFY_STDIN:
           case MSG_IDENTIFY_STDOUT:
         case MSG_IDENTIFY_ENVIRON:          case MSG_IDENTIFY_ENVIRON:
         case MSG_IDENTIFY_CLIENTPID:          case MSG_IDENTIFY_CLIENTPID:
         case MSG_IDENTIFY_DONE:          case MSG_IDENTIFY_DONE:
Line 2179 
Line 2181 
                 c->fd = imsg->fd;                  c->fd = imsg->fd;
                 log_debug("client %p IDENTIFY_STDIN %d", c, imsg->fd);                  log_debug("client %p IDENTIFY_STDIN %d", c, imsg->fd);
                 break;                  break;
           case MSG_IDENTIFY_STDOUT:
                   if (datalen != 0)
                           fatalx("bad MSG_IDENTIFY_STDOUT size");
                   c->out_fd = imsg->fd;
                   log_debug("client %p IDENTIFY_STDOUT %d", c, imsg->fd);
                   break;
         case MSG_IDENTIFY_ENVIRON:          case MSG_IDENTIFY_ENVIRON:
                 if (datalen == 0 || data[datalen - 1] != '\0')                  if (datalen == 0 || data[datalen - 1] != '\0')
                         fatalx("bad MSG_IDENTIFY_ENVIRON string");                          fatalx("bad MSG_IDENTIFY_ENVIRON string");
Line 2207 
Line 2215 
         c->name = name;          c->name = name;
         log_debug("client %p name is %s", c, c->name);          log_debug("client %p name is %s", c, c->name);
   
         if (c->flags & CLIENT_CONTROL) {           if (c->flags & CLIENT_CONTROL)
                 close(c->fd);  
                 c->fd = -1;  
                 control_start(c);                  control_start(c);
         } else if (c->fd != -1) {          else if (c->fd != -1) {
                 if (tty_init(&c->tty, c) != 0) {                  if (tty_init(&c->tty, c) != 0) {
                         close(c->fd);                          close(c->fd);
                         c->fd = -1;                          c->fd = -1;
Line 2219 
Line 2225 
                         tty_resize(&c->tty);                          tty_resize(&c->tty);
                         c->flags |= CLIENT_TERMINAL;                          c->flags |= CLIENT_TERMINAL;
                 }                  }
                   close(c->out_fd);
                   c->out_fd = -1;
         }          }
   
         /*          /*
Line 2335 
Line 2343 
 server_client_set_flags(struct client *c, const char *flags)  server_client_set_flags(struct client *c, const char *flags)
 {  {
         char    *s, *copy, *next;          char    *s, *copy, *next;
         int      flag, not;          uint64_t flag;
           int      not;
   
         s = copy = xstrdup (flags);          s = copy = xstrdup (flags);
         while ((next = strsep(&s, ",")) != NULL) {          while ((next = strsep(&s, ",")) != NULL) {

Legend:
Removed from v.1.350  
changed lines
  Added in v.1.351