summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiung-yu <jiung.yu@samsung.com>2022-06-17 13:54:38 +0900
committerjiung-yu <jiung.yu@samsung.com>2022-06-17 13:55:02 +0900
commit346911646d7804ee00db6a495c22fc61d188a808 (patch)
tree8644ecd12ac33fa4323b9f7e109ead69c8430ae4
parentacb1a41f1073f5fced4bad97a96654fca9b757a6 (diff)
downloadtoybox-346911646d7804ee00db6a495c22fc61d188a808.tar.gz
toybox-346911646d7804ee00db6a495c22fc61d188a808.tar.bz2
toybox-346911646d7804ee00db6a495c22fc61d188a808.zip
Exit when there's error on select()submit/tizen/20220617.051704
Description: Sometimes there's an issue that dhcpd isn't killed by SigTerm and it consumes all CPU usage. We can't reproduce the issue but I think we can terminate dhcpd when select returns an error and errno is not EINTR. Change-Id: I16759a7a5eb35e594eac175496e6f5d87d7d4d25 Signed-off-by: Yu jiung <jiung.yu@samsung.com>
-rw-r--r--packaging/toybox.spec2
-rw-r--r--toys/pending/dhcpd.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/packaging/toybox.spec b/packaging/toybox.spec
index 07d23e8..4a67ea7 100644
--- a/packaging/toybox.spec
+++ b/packaging/toybox.spec
@@ -1,6 +1,6 @@
Name: toybox
Version: 0.6.0
-Release: 1%{?dist}
+Release: 2%{?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 e30c249..2adc60d 100644
--- a/toys/pending/dhcpd.c
+++ b/toys/pending/dhcpd.c
@@ -1713,8 +1713,8 @@ void dhcpd_main(void)
waited += (unsigned) time(NULL) - timestmp;
continue;
}
- dbg("Error in select wait again...\n");
- continue;
+ dbg("Don't wait on Error in select\n");
+ exit(0);
}
if (!retval) { // Timed out
dbg("select wait Timed Out...\n");