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

Diff for /src/usr.bin/mail/popen.c between version 1.19 and 1.20

version 1.19, 1998/08/15 23:17:24 version 1.20, 1998/09/08 15:24:38
Line 221 
Line 221 
  * Run a command without a shell, with optional arguments and splicing   * Run a command without a shell, with optional arguments and splicing
  * of stdin and stdout.  The command name can be a sequence of words.   * of stdin and stdout.  The command name can be a sequence of words.
  * Signals must be handled by the caller.   * Signals must be handled by the caller.
  * "Mask" contains the signals to ignore in the new process.   * "nset" contains the signals to ignore in the new process.
  * SIGINT is enabled unless it's in the mask.   * SIGINT is enabled unless it's in "nset".
  */   */
 /*VARARGS4*/  /*VARARGS4*/
 int  int
Line 381 
Line 381 
 wait_child(pid)  wait_child(pid)
         int pid;          int pid;
 {  {
         struct child *cp = findchild(pid, 0);          struct child *cp;
         sigset_t nset, oset;          sigset_t nset, oset;
   
         if (cp == NULL)  
                 return(-1);  
   
         sigemptyset(&nset);          sigemptyset(&nset);
         sigaddset(&nset, SIGCHLD);          sigaddset(&nset, SIGCHLD);
         sigprocmask(SIG_BLOCK, &nset, &oset);          sigprocmask(SIG_BLOCK, &nset, &oset);
   
           if ((cp = findchild(pid, 0)) == NULL)
                   return(-1);
   
         while (!cp->done)          while (!cp->done)
                 sigsuspend(&oset);                  sigsuspend(&oset);
         wait_status = cp->status;          wait_status = cp->status;
Line 406 
Line 406 
 free_child(pid)  free_child(pid)
         int pid;          int pid;
 {  {
         struct child *cp = findchild(pid, 0);          struct child *cp;
         sigset_t nset, oset;          sigset_t nset, oset;
   
         if (cp == NULL)  
                 return;  
   
         sigemptyset(&nset);          sigemptyset(&nset);
         sigaddset(&nset, SIGCHLD);          sigaddset(&nset, SIGCHLD);
         sigprocmask(SIG_BLOCK, &nset, &oset);          sigprocmask(SIG_BLOCK, &nset, &oset);
   
           if ((cp = findchild(pid, 0)) == NULL)
                   return;
   
         if (cp->done)          if (cp->done)
                 delchild(cp);                  delchild(cp);

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20