[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.189 and 1.190

version 1.189, 2020/05/16 15:24:28 version 1.190, 2020/05/16 15:47:22
Line 51 
Line 51 
   
 struct cmd_find_state    marked_pane;  struct cmd_find_state    marked_pane;
   
   static u_int             message_next;
   struct message_list      message_log;
   
 static int      server_loop(void);  static int      server_loop(void);
 static void     server_send_exit(void);  static void     server_send_exit(void);
 static void     server_accept(int, short, void *);  static void     server_accept(int, short, void *);
Line 195 
Line 198 
         TAILQ_INIT(&clients);          TAILQ_INIT(&clients);
         RB_INIT(&sessions);          RB_INIT(&sessions);
         key_bindings_init();          key_bindings_init();
           TAILQ_INIT(&message_log);
   
         gettimeofday(&start_time, NULL);          gettimeofday(&start_time, NULL);
   
Line 482 
Line 486 
                 }                  }
         }          }
         job_check_died(pid, status);          job_check_died(pid, status);
   }
   
   /* Add to message log. */
   void
   server_add_message(const char *fmt, ...)
   {
           struct message_entry    *msg, *msg1;
           char                    *s;
           va_list                  ap;
           u_int                    limit;
   
           va_start(ap, fmt);
           xvasprintf(&s, fmt, ap);
           va_end(ap);
   
           log_debug("message: %s", s);
   
           msg = xcalloc(1, sizeof *msg);
           gettimeofday(&msg->msg_time, NULL);
           msg->msg_num = message_next++;
           msg->msg = s;
           TAILQ_INSERT_TAIL(&message_log, msg, entry);
   
           limit = options_get_number(global_options, "message-limit");
           TAILQ_FOREACH_SAFE(msg, &message_log, entry, msg1) {
                   if (msg->msg_num + limit >= message_next)
                           break;
                   free(msg->msg);
                   TAILQ_REMOVE(&message_log, msg, entry);
                   free(msg);
           }
 }  }

Legend:
Removed from v.1.189  
changed lines
  Added in v.1.190