[BACK]Return to main.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/main.c between version 1.278 and 1.279

version 1.278, 2017/01/09 01:37:03 version 1.279, 2017/01/09 17:49:57
Line 531  out:
Line 531  out:
   
                         /* Stop here until moved to the foreground. */                          /* Stop here until moved to the foreground. */
   
                         tc_pgid = tcgetpgrp(STDIN_FILENO);                          tc_pgid = tcgetpgrp(tag_files->ofd);
                         if (tc_pgid != man_pgid) {                          if (tc_pgid != man_pgid) {
                                 if (tc_pgid == pager_pid) {                                  if (tc_pgid == pager_pid) {
                                         (void)tcsetpgrp(STDIN_FILENO,                                          (void)tcsetpgrp(tag_files->ofd,
                                             man_pgid);                                              man_pgid);
                                         if (signum == SIGTTIN)                                          if (signum == SIGTTIN)
                                                 continue;                                                  continue;
Line 547  out:
Line 547  out:
                         /* Once in the foreground, activate the pager. */                          /* Once in the foreground, activate the pager. */
   
                         if (pager_pid) {                          if (pager_pid) {
                                 (void)tcsetpgrp(STDIN_FILENO, pager_pid);                                  (void)tcsetpgrp(tag_files->ofd, pager_pid);
                                 kill(pager_pid, SIGCONT);                                  kill(pager_pid, SIGCONT);
                         } else                          } else
                                 pager_pid = spawn_pager(tag_files);                                  pager_pid = spawn_pager(tag_files);
Line 1076  spawn_pager(struct tag_files *tag_files)
Line 1076  spawn_pager(struct tag_files *tag_files)
                 break;                  break;
         default:          default:
                 (void)setpgid(pager_pid, 0);                  (void)setpgid(pager_pid, 0);
                 (void)tcsetpgrp(STDIN_FILENO, pager_pid);                  (void)tcsetpgrp(tag_files->ofd, pager_pid);
 #if HAVE_PLEDGE  #if HAVE_PLEDGE
                 if (pledge("stdio rpath tmppath tty proc", NULL) == -1)                  if (pledge("stdio rpath tmppath tty proc", NULL) == -1)
                         err((int)MANDOCLEVEL_SYSERR, "pledge");                          err((int)MANDOCLEVEL_SYSERR, "pledge");
Line 1094  spawn_pager(struct tag_files *tag_files)
Line 1094  spawn_pager(struct tag_files *tag_files)
   
         /* Do not start the pager before controlling the terminal. */          /* Do not start the pager before controlling the terminal. */
   
         while (tcgetpgrp(STDIN_FILENO) != getpid())          while (tcgetpgrp(STDOUT_FILENO) != getpid())
                 nanosleep(&timeout, NULL);                  nanosleep(&timeout, NULL);
   
         execvp(argv[0], argv);          execvp(argv[0], argv);

Legend:
Removed from v.1.278  
changed lines
  Added in v.1.279

CVSweb