From be282265207bec85db199d500f0e6a7eef780882 Mon Sep 17 00:00:00 2001 From: thorpej Date: Fri, 5 Feb 1999 18:17:27 +0000 Subject: [PATCH] On second thought, don't use atexit(3). Instead, invoke cleanup() directly from catch_sigterm() before calling exit(). This follows the style of the rest of the code. --- usr.sbin/dhcp/client/dhclient.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/usr.sbin/dhcp/client/dhclient.c b/usr.sbin/dhcp/client/dhclient.c index a9e429a1f404..6f44272d21ba 100644 --- a/usr.sbin/dhcp/client/dhclient.c +++ b/usr.sbin/dhcp/client/dhclient.c @@ -56,7 +56,7 @@ #ifndef lint static char copyright[] = -"$Id: dhclient.c,v 1.8 1999/02/05 09:13:32 thorpej Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhclient.c,v 1.9 1999/02/05 18:17:27 thorpej Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -171,10 +171,6 @@ int main (argc, argv, envp) #endif inaddr_any.s_addr = INADDR_ANY; - /* Set up cleanup function. */ - if (atexit (cleanup)) - error ("Unable to register cleanup function."); - /* Set up SIGHUP and SIGTERM handlers. */ sa.sa_handler = catch_sighup; sa.sa_flags = 0; @@ -2128,6 +2124,7 @@ void catch_sigterm (sig) /* Treat this like RELEASE_CURRENT_DHCP_LEASES; release leases. Then exit. */ client_reinit (0); + cleanup(); exit (0); }