summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypserv/yp_main.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1998-06-04 15:11:32 +0000
committerwpaul <wpaul@FreeBSD.org>1998-06-04 15:11:32 +0000
commit6815553adff216ba86ce08e7d9fb7eaab9d0d93c (patch)
treef957355ad432f29e65b82c5710da172c850dcef0 /usr.sbin/ypserv/yp_main.c
parent08171730deae1a1a06a766fed5954212dfa52d0d (diff)
downloadFreeBSD-src-6815553adff216ba86ce08e7d9fb7eaab9d0d93c.zip
FreeBSD-src-6815553adff216ba86ce08e7d9fb7eaab9d0d93c.tar.gz
Protect errno in signal handlers, like in portmap.
Diffstat (limited to 'usr.sbin/ypserv/yp_main.c')
-rw-r--r--usr.sbin/ypserv/yp_main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c
index 1b2546d..59974ad 100644
--- a/usr.sbin/ypserv/yp_main.c
+++ b/usr.sbin/ypserv/yp_main.c
@@ -32,7 +32,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: yp_main.c,v 1.1 1997/11/09 20:54:38 wpaul Exp wpaul $";
+ "$Id: yp_main.c,v 1.17 1998/02/11 19:15:32 wpaul Exp $";
#endif /* not lint */
/*
@@ -158,13 +158,17 @@ static void unregister()
static void reaper(sig)
int sig;
{
- int status;
+ int status;
+ int saved_errno;
+
+ saved_errno = errno;
if (sig == SIGHUP) {
load_securenets();
#ifdef DB_CACHE
yp_flush_all();
#endif
+ errno = saved_errno;
return;
}
@@ -175,6 +179,8 @@ static void reaper(sig)
unregister();
exit(0);
}
+ errno = saved_errno;
+ return;
}
static void usage()
OpenPOWER on IntegriCloud