summaryrefslogtreecommitdiff
path: root/usr.sbin/rbootd
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/rbootd
parent102264589c8731b5f0fb00b204e5963726ecec83 (diff)
Replace the deprecated BSD sigsetmask/sigblock/sigpause functions with their POSIX counterparts.
Diffstat (limited to 'usr.sbin/rbootd')
-rw-r--r--usr.sbin/rbootd/parseconf.c13
-rw-r--r--usr.sbin/rbootd/rbootd.c19
2 files changed, 19 insertions, 13 deletions
diff --git a/usr.sbin/rbootd/parseconf.c b/usr.sbin/rbootd/parseconf.c
index b40b0dac057..db927d08f6e 100644
--- a/usr.sbin/rbootd/parseconf.c
+++ b/usr.sbin/rbootd/parseconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parseconf.c,v 1.4 2001/01/17 00:33:03 pjanzen Exp $ */
+/* $OpenBSD: parseconf.c,v 1.5 2001/09/04 23:35:59 millert Exp $ */
/* $NetBSD: parseconf.c,v 1.4 1995/10/06 05:12:16 thorpej Exp $ */
/*
@@ -49,7 +49,7 @@
#ifndef lint
/*static char sccsid[] = "@(#)parseconf.c 8.1 (Berkeley) 6/4/93";*/
-static char rcsid[] = "$OpenBSD: parseconf.c,v 1.4 2001/01/17 00:33:03 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: parseconf.c,v 1.5 2001/09/04 23:35:59 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -90,7 +90,8 @@ ParseConfig()
char line[C_LINELEN];
register char *cp, *bcp;
register int i, j;
- int omask, linecnt = 0;
+ int linecnt = 0;
+ sigset_t mask, omask;
if (BootAny) /* ignore config file */
return(1);
@@ -110,7 +111,9 @@ ParseConfig()
* this could have unexpected results if the server was HUP'd
* whilst reconfiguring. Hence, it is done here.
*/
- omask = sigblock(sigmask(SIGHUP));
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGHUP);
+ sigprocmask(SIG_BLOCK, &mask, &omask);
/*
* GETSTR positions `bcp' at the start of the current token,
@@ -212,7 +215,7 @@ ParseConfig()
(void) fclose(fp); /* close config file */
- (void) sigsetmask(omask); /* reset signal mask */
+ sigprocmask(SIG_SETMASK, &omask, NULL); /* reset signal mask */
return(1); /* return success */
}
diff --git a/usr.sbin/rbootd/rbootd.c b/usr.sbin/rbootd/rbootd.c
index 649d6e94680..b55afe53670 100644
--- a/usr.sbin/rbootd/rbootd.c
+++ b/usr.sbin/rbootd/rbootd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rbootd.c,v 1.7 2001/01/19 17:53:18 deraadt Exp $ */
+/* $OpenBSD: rbootd.c,v 1.8 2001/09/04 23:35:59 millert Exp $ */
/* $NetBSD: rbootd.c,v 1.5 1995/10/06 05:12:17 thorpej Exp $ */
/*
@@ -55,7 +55,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "@(#)rbootd.c 8.1 (Berkeley) 6/4/93";*/
-static char rcsid[] = "$OpenBSD: rbootd.c,v 1.7 2001/01/19 17:53:18 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rbootd.c,v 1.8 2001/09/04 23:35:59 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -79,8 +79,9 @@ main(argc, argv)
int argc;
char *argv[];
{
- int c, fd, omask, maxfds;
+ int c, fd, maxfds;
fd_set rset;
+ sigset_t hmask, omask;
/*
* Close any open file descriptors.
@@ -201,7 +202,9 @@ main(argc, argv)
/*
* Initial configuration.
*/
- omask = sigblock(sigmask(SIGHUP)); /* prevent reconfig's */
+ sigemptyset(&hmask);
+ sigaddset(&hmask, SIGHUP);
+ sigprocmask(SIG_BLOCK, &hmask, &omask); /* prevent reconfig's */
if (GetBootFiles() == 0) /* get list of boot files */
Exit(0);
if (ParseConfig() == 0) /* parse config file */
@@ -214,7 +217,7 @@ main(argc, argv)
*/
fd = BpfOpen();
- (void) sigsetmask(omask); /* allow reconfig's */
+ sigprocmask(SIG_SETMASK, &omask, NULL); /* allow reconfig's */
/*
* Main loop: receive a packet, determine where it came from,
@@ -259,7 +262,7 @@ main(argc, argv)
if (DbgFp != NULL) /* display packet */
DispPkt(&rconn,DIR_RCVD);
- omask = sigblock(sigmask(SIGHUP));
+ sigprocmask(SIG_BLOCK, &hmask, &omask);
/*
* If we do not restrict service, set the
@@ -274,13 +277,13 @@ main(argc, argv)
syslog(LOG_INFO,
"%s: boot packet ignored",
EnetStr(&rconn));
- (void) sigsetmask(omask);
+ sigprocmask(SIG_SETMASK, &omask, NULL);
continue;
}
ProcessPacket(&rconn,client);
- (void) sigsetmask(omask);
+ sigprocmask(SIG_SETMASK, &omask, NULL);
}
}
}