summaryrefslogtreecommitdiff
path: root/usr.sbin/edquota/edquota.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-09-04 23:36:00 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-09-04 23:36:00 +0000
commit6e69b2a3e9a34411460d33a432a805b3eb1924d1 (patch)
tree33cfe52f5da9645a00ca15af49ceefdd612696d2 /usr.sbin/edquota/edquota.c
parent102264589c8731b5f0fb00b204e5963726ecec83 (diff)
Replace the deprecated BSD sigsetmask/sigblock/sigpause functions with their POSIX counterparts.
Diffstat (limited to 'usr.sbin/edquota/edquota.c')
-rw-r--r--usr.sbin/edquota/edquota.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c
index f3c41296c78..64de9f771d3 100644
--- a/usr.sbin/edquota/edquota.c
+++ b/usr.sbin/edquota/edquota.c
@@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)edquota.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: edquota.c,v 1.27 2001/01/15 05:17:17 angelos Exp $";
+static char *rcsid = "$Id: edquota.c,v 1.28 2001/09/04 23:35:59 millert Exp $";
#endif /* not lint */
/*
@@ -361,11 +361,10 @@ int
editit(tmpfile)
char *tmpfile;
{
- int omask;
int pid, stat, xpid;
char *argp[] = {"sh", "-c", NULL, NULL};
- register char *ed;
- char *p;
+ char *ed, *p;
+ sigset_t mask, omask;
if ((ed = getenv("EDITOR")) == (char *)0)
ed = _PATH_VI;
@@ -375,7 +374,11 @@ editit(tmpfile)
(void)sprintf(p, "%s %s", ed, tmpfile);
argp[2] = p;
- omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGINT);
+ sigaddset(&mask, SIGQUIT);
+ sigaddset(&mask, SIGHUP);
+ sigprocmask(SIG_SETMASK, &mask, &omask);
top:
if ((pid = fork()) < 0) {
if (errno == EPROCLIM) {
@@ -392,7 +395,7 @@ editit(tmpfile)
return(0);
}
if (pid == 0) {
- sigsetmask(omask);
+ sigprocmask(SIG_SETMASK, &omask, NULL);
setgid(getgid());
setuid(getuid());
execv(_PATH_BSHELL, argp);
@@ -406,7 +409,7 @@ editit(tmpfile)
else if (WIFEXITED(stat))
break;
}
- sigsetmask(omask);
+ sigprocmask(SIG_SETMASK, &omask, NULL);
if (!WIFEXITED(stat) || WEXITSTATUS(stat) != 0)
return(0);
return(1);