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

Diff for /src/usr.bin/tmux/client.c between version 1.149 and 1.150

version 1.149, 2020/09/22 05:23:34 version 1.150, 2020/10/30 18:54:23
Line 36 
Line 36 
 static struct tmuxproc  *client_proc;  static struct tmuxproc  *client_proc;
 static struct tmuxpeer  *client_peer;  static struct tmuxpeer  *client_peer;
 static uint64_t          client_flags;  static uint64_t          client_flags;
   static int               client_suspended;
 static enum {  static enum {
         CLIENT_EXIT_NONE,          CLIENT_EXIT_NONE,
         CLIENT_EXIT_DETACHED,          CLIENT_EXIT_DETACHED,
Line 221 
Line 222 
 client_exit(void)  client_exit(void)
 {  {
         struct client_file      *cf;          struct client_file      *cf;
         size_t                   left;          size_t                   left;
         int                      waiting = 0;          int                      waiting = 0;
   
         RB_FOREACH (cf, client_files, &client_files) {          RB_FOREACH (cf, client_files, &client_files) {
Line 763 
Line 764 
         struct sigaction sigact;          struct sigaction sigact;
         int              status;          int              status;
   
           log_debug("%s: %s", __func__, strsignal(sig));
         if (sig == SIGCHLD)          if (sig == SIGCHLD)
                 waitpid(WAIT_ANY, &status, WNOHANG);                  waitpid(WAIT_ANY, &status, WNOHANG);
         else if (!client_attached) {          else if (!client_attached) {
Line 776 
Line 778 
                         proc_send(client_peer, MSG_EXITING, -1, NULL, 0);                          proc_send(client_peer, MSG_EXITING, -1, NULL, 0);
                         break;                          break;
                 case SIGTERM:                  case SIGTERM:
                         client_exitreason = CLIENT_EXIT_TERMINATED;                          if (!client_suspended)
                                   client_exitreason = CLIENT_EXIT_TERMINATED;
                         client_exitval = 1;                          client_exitval = 1;
                         proc_send(client_peer, MSG_EXITING, -1, NULL, 0);                          proc_send(client_peer, MSG_EXITING, -1, NULL, 0);
                         break;                          break;
Line 791 
Line 794 
                         if (sigaction(SIGTSTP, &sigact, NULL) != 0)                          if (sigaction(SIGTSTP, &sigact, NULL) != 0)
                                 fatal("sigaction failed");                                  fatal("sigaction failed");
                         proc_send(client_peer, MSG_WAKEUP, -1, NULL, 0);                          proc_send(client_peer, MSG_WAKEUP, -1, NULL, 0);
                           client_suspended = 0;
                         break;                          break;
                 }                  }
         }          }
Line 1003 
Line 1007 
                 sigact.sa_handler = SIG_DFL;                  sigact.sa_handler = SIG_DFL;
                 if (sigaction(SIGTSTP, &sigact, NULL) != 0)                  if (sigaction(SIGTSTP, &sigact, NULL) != 0)
                         fatal("sigaction failed");                          fatal("sigaction failed");
                   client_suspended = 1;
                 kill(getpid(), SIGTSTP);                  kill(getpid(), SIGTSTP);
                 break;                  break;
         case MSG_LOCK:          case MSG_LOCK:

Legend:
Removed from v.1.149  
changed lines
  Added in v.1.150