commit:     67e2d6033dd7ac6db0269ee060ed20484825ff9f
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Tue Oct  9 16:34:52 2018 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Oct  9 16:34:52 2018 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=67e2d603

Complete implementation of forever timeout value in stop schedules

 src/rc/rc-schedules.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/rc/rc-schedules.c b/src/rc/rc-schedules.c
index 8f36f073..f7ef20fb 100644
--- a/src/rc/rc-schedules.c
+++ b/src/rc/rc-schedules.c
@@ -351,8 +351,9 @@ int run_stop_schedule(const char *applet,
 
                        tkilled += nkilled;
                        break;
+               case SC_FOREVER:
                case SC_TIMEOUT:
-                       if (item->value < 1) {
+                       if (item->type == SC_TIMEOUT && item->value < 1) {
                                item = NULL;
                                break;
                        }
@@ -360,7 +361,7 @@ int run_stop_schedule(const char *applet,
                        ts.tv_sec = 0;
                        ts.tv_nsec = POLL_INTERVAL;
 
-                       for (nsecs = 0; nsecs < item->value; nsecs++) {
+                       for (nsecs = 0; item->type == SC_FOREVER || nsecs < 
item->value; nsecs++) {
                                for (nloops = 0;
                                     nloops < ONE_SECOND / POLL_INTERVAL;
                                     nloops++)

Reply via email to