From 56d6aa4a662c60930b857b9fea6d8df98903c02c Mon Sep 17 00:00:00 2001 From: Ralph Campbell Date: Wed, 9 Jan 1985 18:18:24 -0800 Subject: [PATCH] use sigmask() macro SCCS-vsn: usr.bin/mail/collect.c 2.18 SCCS-vsn: usr.bin/mail/popen.c 1.8 SCCS-vsn: usr.bin/mail/fio.c 2.18 --- usr/src/usr.bin/mail/collect.c | 8 ++++---- usr/src/usr.bin/mail/fio.c | 8 ++++---- usr/src/usr.bin/mail/popen.c | 8 +++----- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/usr/src/usr.bin/mail/collect.c b/usr/src/usr.bin/mail/collect.c index ff16daf894..2a440457d7 100644 --- a/usr/src/usr.bin/mail/collect.c +++ b/usr/src/usr.bin/mail/collect.c @@ -1,5 +1,5 @@ #ifndef lint -static char sccsid[] = "@(#)collect.c 2.17 (Berkeley) %G%"; +static char sccsid[] = "@(#)collect.c 2.18 (Berkeley) %G%"; #endif /* @@ -59,9 +59,9 @@ collect(hp) hadintr = 0; # ifdef VMUNIX if ((savesig = sigset(SIGINT, SIG_IGN)) != SIG_IGN) - sigset(SIGINT, hf ? intack : collrub), sigblock(mask(SIGINT)); + sigset(SIGINT, hf ? intack : collrub), sigblock(sigmask(SIGINT)); if ((savehup = sigset(SIGHUP, SIG_IGN)) != SIG_IGN) - sigset(SIGHUP, collrub), sigblock(mask(SIGHUP)); + sigset(SIGHUP, collrub), sigblock(sigmask(SIGHUP)); savecont = sigset(SIGCONT, collcont); # else VMUNIX savesig = signal(SIGINT, SIG_IGN); @@ -102,7 +102,7 @@ collect(hp) escape = *cp; eof = 0; for (;;) { - int omask = sigblock(0) &~ (mask(SIGINT)|mask(SIGHUP)); + int omask = sigblock(0) &~ (sigmask(SIGINT)|sigmask(SIGHUP)); setjmp(coljmp); # ifdef VMUNIX diff --git a/usr/src/usr.bin/mail/fio.c b/usr/src/usr.bin/mail/fio.c index 80fe86683e..35d0fc6f0f 100644 --- a/usr/src/usr.bin/mail/fio.c +++ b/usr/src/usr.bin/mail/fio.c @@ -1,5 +1,5 @@ #ifndef lint -static char sccsid[] = "@(#)fio.c 2.17 (Berkeley) %G%"; +static char sccsid[] = "@(#)fio.c 2.18 (Berkeley) %G%"; #endif #include "rcv.h" @@ -395,7 +395,7 @@ done: } static int sigdepth = 0; /* depth of holdsigs() */ -static int sigmask = 0; +static int omask = 0; /* * Hold signals SIGHUP - SIGQUIT. */ @@ -404,7 +404,7 @@ holdsigs() register int i; if (sigdepth++ == 0) - sigmask = sigblock(mask(SIGHUP)|mask(SIGINT)|mask(SIGQUIT)); + omask = sigblock(sigmask(SIGHUP)|sigmask(SIGINT)|sigmask(SIGQUIT)); } /* @@ -415,7 +415,7 @@ relsesigs() register int i; if (--sigdepth == 0) - sigsetmask(sigmask); + sigsetmask(omask); } /* diff --git a/usr/src/usr.bin/mail/popen.c b/usr/src/usr.bin/mail/popen.c index 5e58f1fc1d..76b0e8cb73 100644 --- a/usr/src/usr.bin/mail/popen.c +++ b/usr/src/usr.bin/mail/popen.c @@ -1,5 +1,5 @@ #ifndef lint -static char sccsid[] = "@(#)popen.c 1.7 (Berkeley) %G%"; +static char sccsid[] = "@(#)popen.c 1.8 (Berkeley) %G%"; #endif #include @@ -10,9 +10,7 @@ static char sccsid[] = "@(#)popen.c 1.7 (Berkeley) %G%"; #define WTR 1 static int popen_pid[20]; -#ifdef VMUNIX -#define mask(s) (1<<((s)-1)) -#else +#ifndef VMUNIX #define vfork fork #endif VMUNIX #ifndef SIGRETRO @@ -57,7 +55,7 @@ FILE *ptr; f = fileno(ptr); fclose(ptr); # ifdef VMUNIX - omask = sigblock(mask(SIGINT)|mask(SIGQUIT)|mask(SIGHUP)); + omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP)); # endif VMUNIX while((r = wait(&status)) != popen_pid[f] && r != -1 && errno != EINTR) ; -- 2.20.1