diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-09-04 23:36:00 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-09-04 23:36:00 +0000 |
commit | 6e69b2a3e9a34411460d33a432a805b3eb1924d1 (patch) | |
tree | 33cfe52f5da9645a00ca15af49ceefdd612696d2 /usr.bin/systat/cmds.c | |
parent | 102264589c8731b5f0fb00b204e5963726ecec83 (diff) |
Replace the deprecated BSD sigsetmask/sigblock/sigpause functions with their POSIX counterparts.
Diffstat (limited to 'usr.bin/systat/cmds.c')
-rw-r--r-- | usr.bin/systat/cmds.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/systat/cmds.c b/usr.bin/systat/cmds.c index 6804c4c981a..f27ffa4bf35 100644 --- a/usr.bin/systat/cmds.c +++ b/usr.bin/systat/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.5 1997/06/23 22:21:45 millert Exp $ */ +/* $OpenBSD: cmds.c,v 1.6 2001/09/04 23:35:59 millert Exp $ */ /* $NetBSD: cmds.c,v 1.4 1996/05/10 23:16:32 thorpej Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95"; #endif -static char rcsid[] = "$OpenBSD: cmds.c,v 1.5 1997/06/23 22:21:45 millert Exp $"; +static char rcsid[] = "$OpenBSD: cmds.c,v 1.6 2001/09/04 23:35:59 millert Exp $"; #endif /* not lint */ #include <stdlib.h> @@ -55,9 +55,12 @@ command(cmd) { register struct cmdtab *p; register char *cp; - int interval, omask; + int interval; + sigset_t mask, omask; - omask = sigblock(sigmask(SIGALRM)); + sigemptyset(&mask); + sigaddset(&mask, SIGALRM); + sigprocmask(SIG_BLOCK, &mask, &omask); for (cp = cmd; *cp && !isspace(*cp); cp++) ; if (*cp) @@ -144,7 +147,7 @@ command(cmd) if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(cmd, cp)) error("%s: Unknown command.", cmd); done: - sigsetmask(omask); + sigprocmask(SIG_SETMASK, &omask, NULL); } struct cmdtab * |