=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mail/collect.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** src/usr.bin/mail/collect.c 1997/07/14 00:24:25 1.8 --- src/usr.bin/mail/collect.c 1997/07/14 15:56:23 1.9 *************** *** 1,4 **** ! /* $OpenBSD: collect.c,v 1.8 1997/07/14 00:24:25 millert Exp $ */ /* $NetBSD: collect.c,v 1.9 1997/07/09 05:25:45 mikel Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: collect.c,v 1.9 1997/07/14 15:56:23 millert Exp $ */ /* $NetBSD: collect.c,v 1.9 1997/07/09 05:25:45 mikel Exp $ */ /* *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)collect.c 8.2 (Berkeley) 4/19/94"; #else ! static char rcsid[] = "$OpenBSD: collect.c,v 1.8 1997/07/14 00:24:25 millert Exp $"; #endif #endif /* not lint */ --- 38,44 ---- #if 0 static char sccsid[] = "@(#)collect.c 8.2 (Berkeley) 4/19/94"; #else ! static char rcsid[] = "$OpenBSD: collect.c,v 1.9 1997/07/14 15:56:23 millert Exp $"; #endif #endif /* not lint */ *************** *** 86,92 **** char linebuf[LINESIZE], *cp; extern char *tempMail; char getsub; ! int omask; int longline, lastlong, rc; /* Can deal with lines > LINESIZE */ #if __GNUC__ --- 86,92 ---- char linebuf[LINESIZE], *cp; extern char *tempMail; char getsub; ! sigset_t oset, nset; int longline, lastlong, rc; /* Can deal with lines > LINESIZE */ #if __GNUC__ *************** *** 102,108 **** * Start catching signals from here, but we're still die on interrupts * until we're in the main loop. */ ! omask = sigblock(sigmask(SIGINT) | sigmask(SIGHUP)); if ((saveint = signal(SIGINT, SIG_IGN)) != SIG_IGN) signal(SIGINT, collint); if ((savehup = signal(SIGHUP, SIG_IGN)) != SIG_IGN) --- 102,111 ---- * Start catching signals from here, but we're still die on interrupts * until we're in the main loop. */ ! sigemptyset(&nset); ! sigaddset(&nset, SIGINT); ! sigaddset(&nset, SIGHUP); ! sigprocmask(SIG_BLOCK, &nset, &oset); if ((saveint = signal(SIGINT, SIG_IGN)) != SIG_IGN) signal(SIGINT, collint); if ((savehup = signal(SIGHUP, SIG_IGN)) != SIG_IGN) *************** *** 114,120 **** rm(tempMail); goto err; } ! sigsetmask(omask & ~(sigmask(SIGINT) | sigmask(SIGHUP))); noreset++; if ((collf = Fopen(tempMail, "w+")) == NULL) { --- 117,125 ---- rm(tempMail); goto err; } ! sigdelset(&oset, SIGINT); ! sigdelset(&oset, SIGHUP); ! sigprocmask(SIG_SETMASK, &oset, NULL); noreset++; if ((collf = Fopen(tempMail, "w+")) == NULL) { *************** *** 398,410 **** if (collf != NULL) rewind(collf); noreset--; ! sigblock(sigmask(SIGINT) | sigmask(SIGHUP)); signal(SIGINT, saveint); signal(SIGHUP, savehup); signal(SIGTSTP, savetstp); signal(SIGTTOU, savettou); signal(SIGTTIN, savettin); ! sigsetmask(omask); return(collf); } --- 403,418 ---- if (collf != NULL) rewind(collf); noreset--; ! sigemptyset(&nset); ! sigaddset(&nset, SIGINT); ! sigaddset(&nset, SIGHUP); ! sigprocmask(SIG_BLOCK, &nset, &oset); signal(SIGINT, saveint); signal(SIGHUP, savehup); signal(SIGTSTP, savetstp); signal(SIGTTOU, savettou); signal(SIGTTIN, savettin); ! sigprocmask(SIG_SETMASK, &oset, NULL); return(collf); }