diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-01-07 21:12:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-01-07 21:12:25 +0000 |
commit | 8341e9f47ce3b457adc79d16be8c5c294fe84f2c (patch) | |
tree | 18e17b3889ff87445dab4d4c9bee6fcf824a8c9e /libexec/rpc.rstatd/rstatd.c | |
parent | 82aab390bc159cdcf2c898a135cfdfce71d27e6f (diff) |
Inline the cleanup() routine since it is no longer a signal handler
and is only called in one place. It now does a proper exit() instead
of _exit(). OK deraadt@
Diffstat (limited to 'libexec/rpc.rstatd/rstatd.c')
-rw-r--r-- | libexec/rpc.rstatd/rstatd.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/libexec/rpc.rstatd/rstatd.c b/libexec/rpc.rstatd/rstatd.c index 7f482e4f5e6..d9a8fd3b998 100644 --- a/libexec/rpc.rstatd/rstatd.c +++ b/libexec/rpc.rstatd/rstatd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rstatd.c,v 1.16 2003/12/12 05:25:06 deraadt Exp $ */ +/* $OpenBSD: rstatd.c,v 1.17 2004/01/07 21:12:24 millert Exp $ */ /*- * Copyright (c) 1993, John Brezak @@ -29,7 +29,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: rstatd.c,v 1.16 2003/12/12 05:25:06 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: rstatd.c,v 1.17 2004/01/07 21:12:24 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -65,15 +65,6 @@ getsig(int signo) } -static void -cleanup(void) -{ - (void) pmap_unset(RSTATPROG, RSTATVERS_TIME); /* XXX signal races */ - (void) pmap_unset(RSTATPROG, RSTATVERS_SWTCH); - (void) pmap_unset(RSTATPROG, RSTATVERS_ORIG); - _exit(0); -} - int main(int argc, char *argv[]) { @@ -164,8 +155,12 @@ my_svc_run(void) updatestat(); wantupdatestat = 0; } - if (gotsig) - cleanup(); + if (gotsig) { + (void) pmap_unset(RSTATPROG, RSTATVERS_TIME); + (void) pmap_unset(RSTATPROG, RSTATVERS_SWTCH); + (void) pmap_unset(RSTATPROG, RSTATVERS_ORIG); + exit(0); + } if (__svc_fdset) { int bytes = howmany(__svc_fdsetsize, NFDBITS) * |