[BACK]Return to cmd-attach-session.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/cmd-attach-session.c between version 1.21 and 1.22

version 1.21, 2012/07/10 11:53:01 version 1.22, 2012/07/11 07:10:15
Line 26 
Line 26 
  * Attach existing session to the current terminal.   * Attach existing session to the current terminal.
  */   */
   
 int     cmd_attach_session_exec(struct cmd *, struct cmd_ctx *);  enum cmd_retval cmd_attach_session_exec(struct cmd *, struct cmd_ctx *);
   
 const struct cmd_entry cmd_attach_session_entry = {  const struct cmd_entry cmd_attach_session_entry = {
         "attach-session", "attach",          "attach-session", "attach",
Line 38 
Line 38 
         cmd_attach_session_exec          cmd_attach_session_exec
 };  };
   
 int  enum cmd_retval
 cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx)  cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx)
 {  {
         struct args     *args = self->args;          struct args     *args = self->args;
Line 50 
Line 50 
   
         if (RB_EMPTY(&sessions)) {          if (RB_EMPTY(&sessions)) {
                 ctx->error(ctx, "no sessions");                  ctx->error(ctx, "no sessions");
                 return (-1);                  return (CMD_RETURN_ERROR);
         }          }
   
         if ((s = cmd_find_session(ctx, args_get(args, 't'), 1)) == NULL)          if ((s = cmd_find_session(ctx, args_get(args, 't'), 1)) == NULL)
                 return (-1);                  return (CMD_RETURN_ERROR);
   
         if (ctx->cmdclient == NULL && ctx->curclient == NULL)          if (ctx->cmdclient == NULL && ctx->curclient == NULL)
                 return (0);                  return (CMD_RETURN_NORMAL);
   
         if (ctx->cmdclient == NULL) {          if (ctx->cmdclient == NULL) {
                 if (args_has(self->args, 'd')) {                  if (args_has(self->args, 'd')) {
Line 84 
Line 84 
                 if (server_client_open(ctx->cmdclient, s, &cause) != 0) {                  if (server_client_open(ctx->cmdclient, s, &cause) != 0) {
                         ctx->error(ctx, "open terminal failed: %s", cause);                          ctx->error(ctx, "open terminal failed: %s", cause);
                         free(cause);                          free(cause);
                         return (-1);                          return (CMD_RETURN_ERROR);
                 }                  }
   
                 if (args_has(self->args, 'r'))                  if (args_has(self->args, 'r'))
Line 107 
Line 107 
         recalculate_sizes();          recalculate_sizes();
         server_update_socket();          server_update_socket();
   
         return (1);     /* 1 means don't tell command client to exit */          return (CMD_RETURN_ATTACH);
 }  }

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22