Skip to content

Commit

Permalink
initctl.c: fix a return value of run tasks
Browse files Browse the repository at this point in the history
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 <liu.ming50@gmail.com>
  • Loading branch information
liuming50 committed Mar 3, 2022
1 parent 2faefd4 commit e73d4ee
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/initctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] == '!')
Expand Down

0 comments on commit e73d4ee

Please sign in to comment.