diff options
-rw-r--r-- | usr.bin/mail/collect.c | 22 | ||||
-rw-r--r-- | usr.bin/mail/main.c | 8 | ||||
-rw-r--r-- | usr.bin/mail/popen.c | 12 | ||||
-rw-r--r-- | usr.bin/mail/send.c | 5 | ||||
-rw-r--r-- | usr.bin/mail/tty.c | 8 |
5 files changed, 33 insertions, 22 deletions
diff --git a/usr.bin/mail/collect.c b/usr.bin/mail/collect.c index f4912a828d5..64e7d73861b 100644 --- a/usr.bin/mail/collect.c +++ b/usr.bin/mail/collect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: collect.c,v 1.8 1997/07/14 00:24:25 millert Exp $ */ +/* $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,7 +38,7 @@ #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 $"; +static char rcsid[] = "$OpenBSD: collect.c,v 1.9 1997/07/14 15:56:23 millert Exp $"; #endif #endif /* not lint */ @@ -86,7 +86,7 @@ collect(hp, printheaders) char linebuf[LINESIZE], *cp; extern char *tempMail; char getsub; - int omask; + sigset_t oset, nset; int longline, lastlong, rc; /* Can deal with lines > LINESIZE */ #if __GNUC__ @@ -102,7 +102,10 @@ collect(hp, printheaders) * 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)); + 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,7 +117,9 @@ collect(hp, printheaders) rm(tempMail); goto err; } - sigsetmask(omask & ~(sigmask(SIGINT) | sigmask(SIGHUP))); + sigdelset(&oset, SIGINT); + sigdelset(&oset, SIGHUP); + sigprocmask(SIG_SETMASK, &oset, NULL); noreset++; if ((collf = Fopen(tempMail, "w+")) == NULL) { @@ -398,13 +403,16 @@ out: if (collf != NULL) rewind(collf); noreset--; - sigblock(sigmask(SIGINT) | sigmask(SIGHUP)); + 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); - sigsetmask(omask); + sigprocmask(SIG_SETMASK, &oset, NULL); return(collf); } diff --git a/usr.bin/mail/main.c b/usr.bin/mail/main.c index 896da488285..ab759c4a505 100644 --- a/usr.bin/mail/main.c +++ b/usr.bin/mail/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.7 1997/07/14 00:24:28 millert Exp $ */ +/* $OpenBSD: main.c,v 1.8 1997/07/14 15:56:24 millert Exp $ */ /* $NetBSD: main.c,v 1.7 1997/05/13 06:15:57 mikel Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/20/95"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.7 1997/07/14 00:24:28 millert Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.8 1997/07/14 15:56:24 millert Exp $"; #endif #endif /* not lint */ @@ -287,9 +287,9 @@ setscreensize() ospeed = 9600; else ospeed = cfgetospeed(&tbuf); - if (ospeed < 1200) + if (ospeed < B1200) screenheight = 9; - else if (ospeed == 1200) + else if (ospeed == B1200) screenheight = 14; else if (ws.ws_row != 0) screenheight = ws.ws_row; diff --git a/usr.bin/mail/popen.c b/usr.bin/mail/popen.c index 40f63134ba6..61e583dd511 100644 --- a/usr.bin/mail/popen.c +++ b/usr.bin/mail/popen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: popen.c,v 1.8 1997/07/14 00:24:29 millert Exp $ */ +/* $OpenBSD: popen.c,v 1.9 1997/07/14 15:56:24 millert Exp $ */ /* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: popen.c,v 1.8 1997/07/14 00:24:29 millert Exp $"; +static char rcsid[] = "$OpenBSD: popen.c,v 1.9 1997/07/14 15:56:24 millert Exp $"; #endif #endif /* not lint */ @@ -274,7 +274,7 @@ prepare_child(nset, infd, outfd) int infd, outfd; { int i; - sigset_t fset; + sigset_t eset; /* * All file descriptors other than 0, 1, and 2 are supposed to be @@ -293,8 +293,8 @@ prepare_child(nset, infd, outfd) } if (nset == NULL || !sigismember(nset, SIGINT)) (void)signal(SIGINT, SIG_DFL); - sigfillset(&fset); - (void)sigprocmask(SIG_UNBLOCK, &fset, NULL); + sigemptyset(&eset); + (void)sigprocmask(SIG_SETMASK, &eset, NULL); } int @@ -370,6 +370,7 @@ wait_child(pid) { sigset_t nset, oset; register struct child *cp = findchild(pid); + sigemptyset(&nset); sigaddset(&nset, SIGCHLD); sigprocmask(SIG_BLOCK, &nset, &oset); @@ -391,6 +392,7 @@ free_child(pid) { sigset_t nset, oset; register struct child *cp = findchild(pid); + sigemptyset(&nset); sigaddset(&nset, SIGCHLD); sigprocmask(SIG_BLOCK, &nset, &oset); diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c index abc9142fb59..a86a8bcc7aa 100644 --- a/usr.bin/mail/send.c +++ b/usr.bin/mail/send.c @@ -1,4 +1,4 @@ -/* $OpenBSD: send.c,v 1.5 1997/07/14 00:24:30 millert Exp $ */ +/* $OpenBSD: send.c,v 1.6 1997/07/14 15:56:25 millert Exp $ */ /* $NetBSD: send.c,v 1.6 1996/06/08 19:48:39 christos Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)send.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: send.c,v 1.5 1997/07/14 00:24:30 millert Exp $"; +static char rcsid[] = "$OpenBSD: send.c,v 1.6 1997/07/14 15:56:25 millert Exp $"; #endif #endif /* not lint */ @@ -381,6 +381,7 @@ mail1(hp, printheaders) } if (pid == 0) { sigset_t nset; + sigemptyset(&nset); sigaddset(&nset, SIGHUP); sigaddset(&nset, SIGINT); diff --git a/usr.bin/mail/tty.c b/usr.bin/mail/tty.c index 037ffdb664f..b05645662a6 100644 --- a/usr.bin/mail/tty.c +++ b/usr.bin/mail/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.5 1997/07/14 00:24:31 millert Exp $ */ +/* $OpenBSD: tty.c,v 1.6 1997/07/14 15:56:25 millert Exp $ */ /* $NetBSD: tty.c,v 1.7 1997/07/09 05:25:46 mikel Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)tty.c 8.2 (Berkeley) 4/20/95"; #else -static char rcsid[] = "$OpenBSD: tty.c,v 1.5 1997/07/14 00:24:31 millert Exp $"; +static char rcsid[] = "$OpenBSD: tty.c,v 1.6 1997/07/14 15:56:25 millert Exp $"; #endif #endif /* not lint */ @@ -297,9 +297,9 @@ ttystop(s) sigemptyset(&nset); sigaddset(&nset, s); - sigprocmask(SIG_BLOCK, &nset, NULL); - kill(0, s); sigprocmask(SIG_UNBLOCK, &nset, NULL); + kill(0, s); + sigprocmask(SIG_BLOCK, &nset, NULL); signal(s, old_action); siglongjmp(rewrite, 1); } |