[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.120 and 1.121

version 1.120, 2015/04/22 15:05:03 version 1.121, 2015/04/22 15:30:11
Line 137 
Line 137 
         logfile("server");          logfile("server");
         log_debug("server started, pid %ld", (long) getpid());          log_debug("server started, pid %ld", (long) getpid());
   
         ARRAY_INIT(&windows);          RB_INIT(&windows);
         RB_INIT(&all_window_panes);          RB_INIT(&all_window_panes);
         ARRAY_INIT(&clients);          ARRAY_INIT(&clients);
         ARRAY_INIT(&dead_clients);          ARRAY_INIT(&dead_clients);
Line 438 
Line 438 
 void  void
 server_child_exited(pid_t pid, int status)  server_child_exited(pid_t pid, int status)
 {  {
         struct window           *w;          struct window           *w, *w1;
         struct window_pane      *wp;          struct window_pane      *wp;
         struct job              *job;          struct job              *job;
         u_int                    i;  
   
         for (i = 0; i < ARRAY_LENGTH(&windows); i++) {          RB_FOREACH_SAFE(w, windows, &windows, w1) {
                 if ((w = ARRAY_ITEM(&windows, i)) == NULL)  
                         continue;  
                 TAILQ_FOREACH(wp, &w->panes, entry) {                  TAILQ_FOREACH(wp, &w->panes, entry) {
                         if (wp->pid == pid) {                          if (wp->pid == pid) {
                                 wp->status = status;                                  wp->status = status;
Line 469 
Line 466 
 {  {
         struct window           *w;          struct window           *w;
         struct window_pane      *wp;          struct window_pane      *wp;
         u_int                    i;  
   
         if (WSTOPSIG(status) == SIGTTIN || WSTOPSIG(status) == SIGTTOU)          if (WSTOPSIG(status) == SIGTTIN || WSTOPSIG(status) == SIGTTOU)
                 return;                  return;
   
         for (i = 0; i < ARRAY_LENGTH(&windows); i++) {          RB_FOREACH(w, windows, &windows) {
                 if ((w = ARRAY_ITEM(&windows, i)) == NULL)  
                         continue;  
                 TAILQ_FOREACH(wp, &w->panes, entry) {                  TAILQ_FOREACH(wp, &w->panes, entry) {
                         if (wp->pid == pid) {                          if (wp->pid == pid) {
                                 if (killpg(pid, SIGCONT) != 0)                                  if (killpg(pid, SIGCONT) != 0)
Line 493 
Line 487 
         struct window           *w;          struct window           *w;
         struct window_pane      *wp;          struct window_pane      *wp;
         struct timeval           tv;          struct timeval           tv;
         u_int                    i;  
   
         if (options_get_number(&global_s_options, "lock-server"))          if (options_get_number(&global_s_options, "lock-server"))
                 server_lock_server();                  server_lock_server();
         else          else
                 server_lock_sessions();                  server_lock_sessions();
   
         for (i = 0; i < ARRAY_LENGTH(&windows); i++) {          RB_FOREACH(w, windows, &windows) {
                 w = ARRAY_ITEM(&windows, i);  
                 if (w == NULL)  
                         continue;  
   
                 TAILQ_FOREACH(wp, &w->panes, entry) {                  TAILQ_FOREACH(wp, &w->panes, entry) {
                         if (wp->mode != NULL && wp->mode->timer != NULL)                          if (wp->mode != NULL && wp->mode->timer != NULL)
                                 wp->mode->timer(wp);                                  wp->mode->timer(wp);

Legend:
Removed from v.1.120  
changed lines
  Added in v.1.121