Remove Sigterm handler 39/277239/1 tizen_6.5
authorjiung-yu <jiung.yu@samsung.com>
Mon, 4 Jul 2022 04:42:19 +0000 (13:42 +0900)
committerJiung Yu <jiung.yu@samsung.com>
Mon, 4 Jul 2022 04:58:49 +0000 (04:58 +0000)
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 <jiung.yu@samsung.com>
(cherry picked from commit bf5c28a078f9d0bec9f03ed81d3ff59a51d77385)

packaging/toybox.spec
toys/pending/dhcpd.c

index 4a67ea7..07d23e8 100644 (file)
@@ -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
index 6a436e5..c0323bf 100644 (file)
@@ -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;
       }
     }