[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.147 and 1.148

version 1.147, 2020/06/10 07:27:10 version 1.148, 2020/06/18 08:34:22
Line 35 
Line 35 
   
 static struct tmuxproc  *client_proc;  static struct tmuxproc  *client_proc;
 static struct tmuxpeer  *client_peer;  static struct tmuxpeer  *client_peer;
 static int               client_flags;  static uint64_t          client_flags;
 static enum {  static enum {
         CLIENT_EXIT_NONE,          CLIENT_EXIT_NONE,
         CLIENT_EXIT_DETACHED,          CLIENT_EXIT_DETACHED,
Line 247 
Line 247 
         pid_t                    ppid;          pid_t                    ppid;
         enum msgtype             msg;          enum msgtype             msg;
         struct termios           tio, saved_tio;          struct termios           tio, saved_tio;
         size_t                   size;          size_t                   size, linesize = 0;
           ssize_t                  linelen;
           char                    *line = NULL;
   
         /* Ignore SIGCHLD now or daemon() in the server will leave a zombie. */          /* Ignore SIGCHLD now or daemon() in the server will leave a zombie. */
         signal(SIGCHLD, SIG_IGN);          signal(SIGCHLD, SIG_IGN);
Line 276 
Line 278 
                         free(pr->error);                          free(pr->error);
         }          }
   
         /* Save the flags. */  
         client_flags = flags;  
   
         /* Create client process structure (starts logging). */          /* Create client process structure (starts logging). */
         client_proc = proc_start("client");          client_proc = proc_start("client");
         proc_set_signals(client_proc, client_signal);          proc_set_signals(client_proc, client_signal);
   
           /* Save the flags. */
           client_flags = flags;
           log_debug("flags are %#llx", client_flags);
   
         /* Initialize the client socket and start the server. */          /* Initialize the client socket and start the server. */
         fd = client_connect(base, socket_path, client_flags);          fd = client_connect(base, socket_path, client_flags);
         if (fd == -1) {          if (fd == -1) {
Line 406 
Line 409 
                         printf("%%exit %s\n", client_exit_message());                          printf("%%exit %s\n", client_exit_message());
                 else                  else
                         printf("%%exit\n");                          printf("%%exit\n");
                   fflush(stdout);
                   if (client_flags & CLIENT_CONTROL_WAITEXIT) {
                           setvbuf(stdin, NULL, _IOLBF, 0);
                           for (;;) {
                                   linelen = getline(&line, &linesize, stdin);
                                   if (linelen <= 1)
                                           break;
                           }
                           free(line);
                   }
                 if (client_flags & CLIENT_CONTROLCONTROL) {                  if (client_flags & CLIENT_CONTROLCONTROL) {
                         printf("\033\\");                          printf("\033\\");
                           fflush(stdout);
                         tcsetattr(STDOUT_FILENO, TCSAFLUSH, &saved_tio);                          tcsetattr(STDOUT_FILENO, TCSAFLUSH, &saved_tio);
                 }                  }
         } else if (client_exitreason != CLIENT_EXIT_NONE)          } else if (client_exitreason != CLIENT_EXIT_NONE)
Line 870 
Line 884 
                 client_exitval = 1;                  client_exitval = 1;
                 proc_exit(client_proc);                  proc_exit(client_proc);
                 break;                  break;
           case MSG_FLAGS:
                   if (datalen != sizeof client_flags)
                           fatalx("bad MSG_FLAGS string");
   
                   memcpy(&client_flags, data, sizeof client_flags);
                   log_debug("new flags are %#llx", client_flags);
                   break;
         case MSG_SHELL:          case MSG_SHELL:
                 if (datalen == 0 || data[datalen - 1] != '\0')                  if (datalen == 0 || data[datalen - 1] != '\0')
                         fatalx("bad MSG_SHELL string");                          fatalx("bad MSG_SHELL string");
Line 916 
Line 937 
         datalen = imsg->hdr.len - IMSG_HEADER_SIZE;          datalen = imsg->hdr.len - IMSG_HEADER_SIZE;
   
         switch (imsg->hdr.type) {          switch (imsg->hdr.type) {
           case MSG_FLAGS:
                   if (datalen != sizeof client_flags)
                           fatalx("bad MSG_FLAGS string");
   
                   memcpy(&client_flags, data, sizeof client_flags);
                   log_debug("new flags are %#llx", client_flags);
                   break;
         case MSG_DETACH:          case MSG_DETACH:
         case MSG_DETACHKILL:          case MSG_DETACHKILL:
                 if (datalen == 0 || data[datalen - 1] != '\0')                  if (datalen == 0 || data[datalen - 1] != '\0')

Legend:
Removed from v.1.147  
changed lines
  Added in v.1.148