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

Diff for /src/usr.bin/tmux/cmd-pipe-pane.c between version 1.44 and 1.45

version 1.44, 2017/07/12 09:24:17 version 1.45, 2017/07/12 10:04:51
Line 22 
Line 22 
 #include <errno.h>  #include <errno.h>
 #include <fcntl.h>  #include <fcntl.h>
 #include <paths.h>  #include <paths.h>
   #include <signal.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
 #include <time.h>  #include <time.h>
Line 62 
Line 63 
         char                    *cmd;          char                    *cmd;
         int                      old_fd, pipe_fd[2], null_fd;          int                      old_fd, pipe_fd[2], null_fd;
         struct format_tree      *ft;          struct format_tree      *ft;
           sigset_t                 set, oldset;
   
         /* Destroy the old pipe. */          /* Destroy the old pipe. */
         old_fd = wp->pipe_fd;          old_fd = wp->pipe_fd;
Line 102 
Line 104 
         format_free(ft);          format_free(ft);
   
         /* Fork the child. */          /* Fork the child. */
           sigfillset(&set);
           sigprocmask(SIG_BLOCK, &set, &oldset);
         switch (fork()) {          switch (fork()) {
         case -1:          case -1:
                   sigprocmask(SIG_SETMASK, &oldset, NULL);
                 cmdq_error(item, "fork error: %s", strerror(errno));                  cmdq_error(item, "fork error: %s", strerror(errno));
   
                 free(cmd);                  free(cmd);
                 return (CMD_RETURN_ERROR);                  return (CMD_RETURN_ERROR);
         case 0:          case 0:
                 /* Child process. */                  /* Child process. */
                 close(pipe_fd[0]);  
                 proc_clear_signals(server_proc);                  proc_clear_signals(server_proc);
                   sigprocmask(SIG_SETMASK, &oldset, NULL);
                   close(pipe_fd[0]);
   
                 if (dup2(pipe_fd[1], STDIN_FILENO) == -1)                  if (dup2(pipe_fd[1], STDIN_FILENO) == -1)
                         _exit(1);                          _exit(1);
Line 132 
Line 138 
                 _exit(1);                  _exit(1);
         default:          default:
                 /* Parent process. */                  /* Parent process. */
                   sigprocmask(SIG_SETMASK, &oldset, NULL);
                 close(pipe_fd[1]);                  close(pipe_fd[1]);
   
                 wp->pipe_fd = pipe_fd[0];                  wp->pipe_fd = pipe_fd[0];

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45