From de543fd066d428950ab3c3672b4c5515600eef54 Mon Sep 17 00:00:00 2001 From: jiung-yu Date: Mon, 4 Jul 2022 13:42:19 +0900 Subject: [PATCH] Remove Sigterm handler Description: DF220609-00728 dhcpd doesn't killed by Sigterm 15. The lease file will be erased by wifi-direct-dhcp.sh before dhcp or dhcpd is started. Change-Id: I55fd41274c947f04b76d6c08a7840a0a9bc213f7 Signed-off-by: Yu jiung (cherry picked from commit bf5c28a078f9d0bec9f03ed81d3ff59a51d77385) --- packaging/toybox.spec | 2 +- toys/pending/dhcpd.c | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/packaging/toybox.spec b/packaging/toybox.spec index 4a67ea7..07d23e8 100644 --- a/packaging/toybox.spec +++ b/packaging/toybox.spec @@ -1,6 +1,6 @@ Name: toybox Version: 0.6.0 -Release: 2%{?dist} +Release: 1%{?dist} Summary: Single binary providing simplified versions of system commands Group: Base/Utilities License: BSD-2.0 diff --git a/toys/pending/dhcpd.c b/toys/pending/dhcpd.c index 6a436e5..c0323bf 100644 --- a/toys/pending/dhcpd.c +++ b/toys/pending/dhcpd.c @@ -511,7 +511,6 @@ static int setup_signal() int flags = fcntl(sigfd.wr, F_GETFL); fcntl(sigfd.wr, F_SETFL, flags | O_NONBLOCK); signal(SIGUSR1, signal_handler); - signal(SIGTERM, signal_handler); return 0; } @@ -1713,8 +1712,8 @@ void dhcpd_main(void) waited += (unsigned) time(NULL) - timestmp; continue; } - dbg("Don't wait on Error in select\n"); - exit(0); + dbg("Error in select wait again...\n"); + continue; } if (!retval) { // Timed out dbg("select wait Timed Out...\n"); @@ -1740,12 +1739,6 @@ void dhcpd_main(void) infomsg(infomode, "Received SIGUSR1"); (addr_version==AF_INET6)? write_lease6file() : write_leasefile(); continue; - case SIGTERM: - infomsg(infomode, "received sigterm"); - (addr_version==AF_INET6)? write_lease6file() : write_leasefile(); - unlink(gconfig.pidfile); - exit(0); - break; default: break; } } -- 2.7.4