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

Diff for /src/usr.bin/tmux/job.c between version 1.61 and 1.62

version 1.61, 2021/08/13 19:27:25 version 1.62, 2021/08/13 19:55:11
Line 52 
Line 52 
   
         char                    *cmd;          char                    *cmd;
         pid_t                    pid;          pid_t                    pid;
           char                     tty[TTY_NAME_MAX];
         int                      status;          int                      status;
   
         int                      fd;          int                      fd;
Line 81 
Line 82 
         const char       *home;          const char       *home;
         sigset_t          set, oldset;          sigset_t          set, oldset;
         struct winsize    ws;          struct winsize    ws;
         char            **argvp;          char            **argvp, tty[TTY_NAME_MAX];
   
         /*          /*
          * Do not set TERM during .tmux.conf, it is nice to be able to use           * Do not set TERM during .tmux.conf, it is nice to be able to use
Line 96 
Line 97 
                 memset(&ws, 0, sizeof ws);                  memset(&ws, 0, sizeof ws);
                 ws.ws_col = sx;                  ws.ws_col = sx;
                 ws.ws_row = sy;                  ws.ws_row = sy;
                 pid = fdforkpty(ptm_fd, &master, NULL, NULL, &ws);                  pid = fdforkpty(ptm_fd, &master, tty, NULL, &ws);
         } else {          } else {
                 if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, out) != 0)                  if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, out) != 0)
                         goto fail;                          goto fail;
Line 170 
Line 171 
         else          else
                 job->cmd = cmd_stringify_argv(argc, argv);                  job->cmd = cmd_stringify_argv(argc, argv);
         job->pid = pid;          job->pid = pid;
           strlcpy(job->tty, tty, sizeof job->tty);
         job->status = 0;          job->status = 0;
   
         LIST_INSERT_HEAD(&all_jobs, job, entry);          LIST_INSERT_HEAD(&all_jobs, job, entry);
Line 203 
Line 205 
   
 /* Take job's file descriptor and free the job. */  /* Take job's file descriptor and free the job. */
 int  int
 job_transfer(struct job *job)  job_transfer(struct job *job, pid_t *pid, char *tty, size_t ttylen)
 {  {
         int     fd = job->fd;          int     fd = job->fd;
   
         log_debug("transfer job %p: %s", job, job->cmd);          log_debug("transfer job %p: %s", job, job->cmd);
   
           if (pid != NULL)
                   *pid = job->pid;
           if (tty != NULL)
                   strlcpy(tty, job->tty, ttylen);
   
         LIST_REMOVE(job, entry);          LIST_REMOVE(job, entry);
         free(job->cmd);          free(job->cmd);

Legend:
Removed from v.1.61  
changed lines
  Added in v.1.62