summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-02-18 22:20:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-02-18 22:20:56 +0000
commit70d45d96856973d63681c1ea4b425a81e59f2029 (patch)
tree40b61c9368fce9445ee1ca425faeaf43e9dd53e6
parent3a845e678f27cd7f807c54ce26c16c53ca1a9a07 (diff)
minor signal race fixes
-rw-r--r--usr.sbin/ypserv/ypserv/ypserv.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.sbin/ypserv/ypserv/ypserv.c b/usr.sbin/ypserv/ypserv/ypserv.c
index 944fb7cac0d..ba24fbc22ac 100644
--- a/usr.sbin/ypserv/ypserv/ypserv.c
+++ b/usr.sbin/ypserv/ypserv/ypserv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypserv.c,v 1.19 2002/02/16 21:28:11 millert Exp $ */
+/* $OpenBSD: ypserv.c,v 1.20 2002/02/18 22:20:55 deraadt Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
@@ -32,7 +32,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: ypserv.c,v 1.19 2002/02/16 21:28:11 millert Exp $";
+static char rcsid[] = "$OpenBSD: ypserv.c,v 1.20 2002/02/18 22:20:55 deraadt Exp $";
#endif
#include <sys/types.h>
@@ -104,6 +104,8 @@ void _msgout(char* msg)
static void
closedown(void)
{
+ int save_errno = errno;
+
if (_rpcsvcdirty == 0) {
extern fd_set *__svc_fdset;
extern int __svc_fdsetsize;
@@ -115,9 +117,10 @@ closedown(void)
if (FD_ISSET(i, __svc_fdset))
openfd++;
if (openfd <= (_rpcpmstart?0:1))
- exit(0);
+ _exit(0);
}
(void) alarm(_RPCSVC_CLOSEDOWN);
+ errno = save_errno;
}
static void
@@ -567,11 +570,6 @@ sig_child(int signo)
errno = save_errno;
}
-/*
- * XXX
- * This is calling illegal functions inside a signal routine.
- * It's a massive race.
- */
void
sig_hup(int signo)
{