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

Diff for /src/usr.bin/tmux/server-fn.c between version 1.129 and 1.130

version 1.129, 2021/01/04 08:43:16 version 1.130, 2021/02/01 08:01:14
Line 401 
Line 401 
 static struct session *  static struct session *
 server_next_session(struct session *s)  server_next_session(struct session *s)
 {  {
         struct session *s_loop, *s_out;          struct session *s_loop, *s_out = NULL;
   
         s_out = NULL;  
         RB_FOREACH(s_loop, sessions, &sessions) {          RB_FOREACH(s_loop, sessions, &sessions) {
                 if (s_loop == s)                  if (s_loop == s)
                         continue;                          continue;
Line 414 
Line 413 
         return (s_out);          return (s_out);
 }  }
   
   static struct session *
   server_next_detached_session(struct session *s)
   {
           struct session *s_loop, *s_out = NULL;
   
           RB_FOREACH(s_loop, sessions, &sessions) {
                   if (s_loop == s || s_loop->attached)
                           continue;
                   if (s_out == NULL ||
                       timercmp(&s_loop->activity_time, &s_out->activity_time, <))
                           s_out = s_loop;
           }
           return (s_out);
   }
   
 void  void
 server_destroy_session(struct session *s)  server_destroy_session(struct session *s)
 {  {
         struct client   *c;          struct client   *c;
         struct session  *s_new;          struct session  *s_new;
           int              detach_on_destroy;
   
         if (!options_get_number(s->options, "detach-on-destroy"))          detach_on_destroy = options_get_number(s->options, "detach-on-destroy");
           if (detach_on_destroy == 0)
                 s_new = server_next_session(s);                  s_new = server_next_session(s);
           else if (detach_on_destroy == 2)
                   s_new = server_next_detached_session(s);
         else          else
                 s_new = NULL;                  s_new = NULL;
   
         TAILQ_FOREACH(c, &clients, entry) {          TAILQ_FOREACH(c, &clients, entry) {
                 if (c->session != s)                  if (c->session != s)
                         continue;                          continue;

Legend:
Removed from v.1.129  
changed lines
  Added in v.1.130