diff options
author | Shawn Routhier <sar@isc.org> | 2013-10-30 13:52:36 -0700 |
---|---|---|
committer | Shawn Routhier <sar@isc.org> | 2013-10-30 13:52:36 -0700 |
commit | 47e8308dea6ee44ce19edf4fdf3331fa41a986f7 (patch) | |
tree | c2801fff3fff0639b504de72675ea62b0d1cab65 /client/dhclient.c | |
parent | 58cb5d861d6f412475722381723dc788c314c39f (diff) | |
download | isc-dhcp-47e8308dea6ee44ce19edf4fdf3331fa41a986f7.tar.gz |
[master]
[32692] Signal handlers added: sigint (ctrl-c) and sigterm (default kill)
Diffstat (limited to 'client/dhclient.c')
-rw-r--r-- | client/dhclient.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/dhclient.c b/client/dhclient.c index c303f7e3..f131e393 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -691,6 +691,10 @@ main(int argc, char **argv) { dmalloc_outstanding = 0; #endif + /* install signal handlers */ + signal(SIGINT, dhcp_signal_handler); /* control-c */ + signal(SIGTERM, dhcp_signal_handler); /* kill */ + /* If we're not supposed to wait before getting the address, don't. */ if (nowait) @@ -704,7 +708,6 @@ main(int argc, char **argv) { /* Start dispatching packets and timeouts... */ dispatch(); - /*NOTREACHED*/ return 0; } @@ -807,7 +810,6 @@ void run_stateless(int exit_mode) /* Start dispatching packets and timeouts... */ dispatch(); - /*NOTREACHED*/ #endif /* DHCPv6 */ return; } |