Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/
Date: Tue, 09 Oct 2018 16:36:04
Message-Id: 1539102892.67e2d6033dd7ac6db0269ee060ed20484825ff9f.williamh@OpenRC
1 commit: 67e2d6033dd7ac6db0269ee060ed20484825ff9f
2 Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
3 AuthorDate: Tue Oct 9 16:34:52 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 9 16:34:52 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=67e2d603
7
8 Complete implementation of forever timeout value in stop schedules
9
10 src/rc/rc-schedules.c | 5 +++--
11 1 file changed, 3 insertions(+), 2 deletions(-)
12
13 diff --git a/src/rc/rc-schedules.c b/src/rc/rc-schedules.c
14 index 8f36f073..f7ef20fb 100644
15 --- a/src/rc/rc-schedules.c
16 +++ b/src/rc/rc-schedules.c
17 @@ -351,8 +351,9 @@ int run_stop_schedule(const char *applet,
18
19 tkilled += nkilled;
20 break;
21 + case SC_FOREVER:
22 case SC_TIMEOUT:
23 - if (item->value < 1) {
24 + if (item->type == SC_TIMEOUT && item->value < 1) {
25 item = NULL;
26 break;
27 }
28 @@ -360,7 +361,7 @@ int run_stop_schedule(const char *applet,
29 ts.tv_sec = 0;
30 ts.tv_nsec = POLL_INTERVAL;
31
32 - for (nsecs = 0; nsecs < item->value; nsecs++) {
33 + for (nsecs = 0; item->type == SC_FOREVER || nsecs < item->value; nsecs++) {
34 for (nloops = 0;
35 nloops < ONE_SECOND / POLL_INTERVAL;
36 nloops++)