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

Diff for /src/usr.bin/mail/collect.c between version 1.8 and 1.9

version 1.8, 1997/07/14 00:24:25 version 1.9, 1997/07/14 15:56:23
Line 86 
Line 86 
         char linebuf[LINESIZE], *cp;          char linebuf[LINESIZE], *cp;
         extern char *tempMail;          extern char *tempMail;
         char getsub;          char getsub;
         int omask;          sigset_t oset, nset;
         int longline, lastlong, rc;     /* Can deal with lines > LINESIZE */          int longline, lastlong, rc;     /* Can deal with lines > LINESIZE */
   
 #if __GNUC__  #if __GNUC__
Line 102 
Line 102 
          * Start catching signals from here, but we're still die on interrupts           * Start catching signals from here, but we're still die on interrupts
          * until we're in the main loop.           * until we're in the main loop.
          */           */
         omask = sigblock(sigmask(SIGINT) | sigmask(SIGHUP));          sigemptyset(&nset);
           sigaddset(&nset, SIGINT);
           sigaddset(&nset, SIGHUP);
           sigprocmask(SIG_BLOCK, &nset, &oset);
         if ((saveint = signal(SIGINT, SIG_IGN)) != SIG_IGN)          if ((saveint = signal(SIGINT, SIG_IGN)) != SIG_IGN)
                 signal(SIGINT, collint);                  signal(SIGINT, collint);
         if ((savehup = signal(SIGHUP, SIG_IGN)) != SIG_IGN)          if ((savehup = signal(SIGHUP, SIG_IGN)) != SIG_IGN)
Line 114 
Line 117 
                 rm(tempMail);                  rm(tempMail);
                 goto err;                  goto err;
         }          }
         sigsetmask(omask & ~(sigmask(SIGINT) | sigmask(SIGHUP)));          sigdelset(&oset, SIGINT);
           sigdelset(&oset, SIGHUP);
           sigprocmask(SIG_SETMASK, &oset, NULL);
   
         noreset++;          noreset++;
         if ((collf = Fopen(tempMail, "w+")) == NULL) {          if ((collf = Fopen(tempMail, "w+")) == NULL) {
Line 398 
Line 403 
         if (collf != NULL)          if (collf != NULL)
                 rewind(collf);                  rewind(collf);
         noreset--;          noreset--;
         sigblock(sigmask(SIGINT) | sigmask(SIGHUP));          sigemptyset(&nset);
           sigaddset(&nset, SIGINT);
           sigaddset(&nset, SIGHUP);
           sigprocmask(SIG_BLOCK, &nset, &oset);
         signal(SIGINT, saveint);          signal(SIGINT, saveint);
         signal(SIGHUP, savehup);          signal(SIGHUP, savehup);
         signal(SIGTSTP, savetstp);          signal(SIGTSTP, savetstp);
         signal(SIGTTOU, savettou);          signal(SIGTTOU, savettou);
         signal(SIGTTIN, savettin);          signal(SIGTTIN, savettin);
         sigsetmask(omask);          sigprocmask(SIG_SETMASK, &oset, NULL);
         return(collf);          return(collf);
 }  }
   

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9