From e73d4eed8d69fd2a059f9bd672e1f354119fd50e Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Thu, 3 Mar 2022 14:16:24 +0100 Subject: [PATCH] initctl.c: fix a return value of run tasks When a run task is started with svc->started = 1, it should be considered started successfully so it should return 0. Signed-off-by: Ming Liu --- src/initctl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/initctl.c b/src/initctl.c index d8235ff8..67e0e6a3 100644 --- a/src/initctl.c +++ b/src/initctl.c @@ -791,8 +791,15 @@ static int show_status(char *arg) if (!svc) return 255; - if (quiet) - return svc->state != SVC_RUNNING_STATE; + if (quiet) { + if (svc_is_runtask(svc)) + if (svc->started) + return 0; + else + return 1; + else + return svc->state != SVC_RUNNING_STATE; + } pidfn = svc->pidfile; if (pidfn[0] == '!')