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

version 1.120, 2017/01/24 19:53:37 version 1.121, 2017/07/12 09:21:25
Line 64 
Line 64 
 static void              client_signal(int);  static void              client_signal(int);
 static void              client_dispatch(struct imsg *, void *);  static void              client_dispatch(struct imsg *, void *);
 static void              client_dispatch_attached(struct imsg *);  static void              client_dispatch_attached(struct imsg *);
 static void              client_dispatch_wait(struct imsg *, const char *);  static void              client_dispatch_wait(struct imsg *);
 static const char       *client_exit_message(void);  static const char       *client_exit_message(void);
   
 /*  /*
Line 215 
Line 215 
   
 /* Client main loop. */  /* Client main loop. */
 int  int
 client_main(struct event_base *base, int argc, char **argv, int flags,  client_main(struct event_base *base, int argc, char **argv, int flags)
     const char *shellcmd)  
 {  {
         struct cmd              *cmd;          struct cmd              *cmd;
         struct cmd_list         *cmdlist;          struct cmd_list         *cmdlist;
Line 237 
Line 236 
   
         /* Set up the initial command. */          /* Set up the initial command. */
         cmdflags = 0;          cmdflags = 0;
         if (shellcmd != NULL) {          if (shell_command != NULL) {
                 msg = MSG_SHELL;                  msg = MSG_SHELL;
                 cmdflags = CMD_STARTSERVER;                  cmdflags = CMD_STARTSERVER;
         } else if (argc == 0) {          } else if (argc == 0) {
Line 276 
Line 275 
                 }                  }
                 return (1);                  return (1);
         }          }
         client_peer = proc_add_peer(client_proc, fd, client_dispatch,          client_peer = proc_add_peer(client_proc, fd, client_dispatch, NULL);
             (void *)shellcmd);  
   
         /* Save these before pledge(). */          /* Save these before pledge(). */
         if ((cwd = getcwd(path, sizeof path)) == NULL) {          if ((cwd = getcwd(path, sizeof path)) == NULL) {
Line 533 
Line 531 
   
 /* Callback for client read events. */  /* Callback for client read events. */
 static void  static void
 client_dispatch(struct imsg *imsg, void *arg)  client_dispatch(struct imsg *imsg, __unused void *arg)
 {  {
         if (imsg == NULL) {          if (imsg == NULL) {
                 client_exitreason = CLIENT_EXIT_LOST_SERVER;                  client_exitreason = CLIENT_EXIT_LOST_SERVER;
Line 545 
Line 543 
         if (client_attached)          if (client_attached)
                 client_dispatch_attached(imsg);                  client_dispatch_attached(imsg);
         else          else
                 client_dispatch_wait(imsg, arg);                  client_dispatch_wait(imsg);
 }  }
   
 /* Dispatch imsgs when in wait state (before MSG_READY). */  /* Dispatch imsgs when in wait state (before MSG_READY). */
 static void  static void
 client_dispatch_wait(struct imsg *imsg, const char *shellcmd)  client_dispatch_wait(struct imsg *imsg)
 {  {
         char                    *data;          char                    *data;
         ssize_t                  datalen;          ssize_t                  datalen;
Line 630 
Line 628 
                         fatalx("bad MSG_SHELL string");                          fatalx("bad MSG_SHELL string");
   
                 clear_signals(0);                  clear_signals(0);
                 client_exec(data, shellcmd);                  client_exec(data, shell_command);
                 /* NOTREACHED */                  /* NOTREACHED */
         case MSG_DETACH:          case MSG_DETACH:
         case MSG_DETACHKILL:          case MSG_DETACHKILL:

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