[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.52 and 1.53

version 1.52, 2009/10/11 07:01:10 version 1.53, 2009/10/11 07:20:16
Line 88 
Line 88 
 void             server_check_redraw(struct client *);  void             server_check_redraw(struct client *);
 void             server_set_title(struct client *);  void             server_set_title(struct client *);
 void             server_check_timers(struct client *);  void             server_check_timers(struct client *);
   void             server_check_jobs(void);
 void             server_lock_server(void);  void             server_lock_server(void);
 void             server_lock_sessions(void);  void             server_lock_sessions(void);
 void             server_check_clients(void);  void             server_check_clients(void);
Line 370 
Line 371 
                         sigusr1 = 0;                          sigusr1 = 0;
                 }                  }
   
                 /* Process client actions. */                  /* Collect any jobs that have died and process clients. */
                   server_check_jobs();
                 server_check_clients();                  server_check_clients();
   
                 /* Initialise pollfd array and add server socket. */                  /* Initialise pollfd array and add server socket. */
Line 389 
Line 391 
   
                 /* Do the poll. */                  /* Do the poll. */
                 pfds = server_poll_flatten(&nfds);                  pfds = server_poll_flatten(&nfds);
                 log_debug("polling %d", nfds);  
                 if (poll(pfds, nfds, xtimeout) == -1) {                  if (poll(pfds, nfds, xtimeout) == -1) {
                         if (errno == EAGAIN || errno == EINTR)                          if (errno == EAGAIN || errno == EINTR)
                                 continue;                                  continue;
Line 510 
Line 511 
 {  {
         struct window           *w;          struct window           *w;
         struct window_pane      *wp;          struct window_pane      *wp;
           struct job              *job;
         int                      status;          int                      status;
         pid_t                    pid;          pid_t                    pid;
         u_int                    i;          u_int                    i;
Line 523 
Line 525 
                 case 0:                  case 0:
                         return;                          return;
                 }                  }
                 if (!WIFSTOPPED(status))                  if (!WIFSTOPPED(status)) {
                           SLIST_FOREACH(job, &all_jobs, lentry) {
                                   if (pid == job->pid) {
                                           job->pid = -1;
                                           job->status = status;
                                   }
                           }
                         continue;                          continue;
                   }
                 if (WSTOPSIG(status) == SIGTTIN || WSTOPSIG(status) == SIGTTOU)                  if (WSTOPSIG(status) == SIGTTIN || WSTOPSIG(status) == SIGTTOU)
                         continue;                          continue;
   
Line 792 
Line 801 
                 if (buffer_poll(pfd, job->out, NULL) != 0) {                  if (buffer_poll(pfd, job->out, NULL) != 0) {
                         close(job->fd);                          close(job->fd);
                         job->fd = -1;                          job->fd = -1;
                         if (job->callbackfn != NULL)  
                                 job->callbackfn(job);  
                 }                  }
           }
   }
   
   /* Handle job fds. */
   void
   server_check_jobs(void)
   {
           struct job      *job;
   
           SLIST_FOREACH(job, &all_jobs, lentry) {
                   if (job->flags & JOB_DONE || job->fd != -1 || job->pid != -1)
                           continue;
                   if (job->callbackfn != NULL)
                           job->callbackfn(job);
                   job->flags |= JOB_DONE;
         }          }
 }  }
   

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53