mirror of
https://github.com/troglobit/finit.git
synced 2026-11-15 19:13:11 +00:00
Fix some wrong return values of run tasks
When a run task is started with svc->started = 1, it should be considered started successfully or failed on the other hand. Signed-off-by: Sergio Morlans <sergio.morlans@atlascopco.com> Signed-off-by: Ming Liu <liu.ming50@gmail.com>
This commit is contained in:
1 parent
2faefd44a2
commit
e1c59a2515
2 files changed
+13
-3
No files matched your search
+9
-2
@@ -791,8 +791,15 @@ static int show_status(char *arg)
|
|||||||
if (!svc)
|
if (!svc)
|
||||||
return 255;
|
return 255;
|
||||||
|
|
||||||
if (quiet)
|
if (quiet) {
|
||||||
return svc->state != SVC_RUNNING_STATE;
|
if (svc_is_runtask(svc))
|
||||||
|
if (svc->started)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return svc->state != SVC_RUNNING_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
pidfn = svc->pidfile;
|
pidfn = svc->pidfile;
|
||||||
if (pidfn[0] == '!')
|
if (pidfn[0] == '!')
|
||||||
|
|||||||
@@ -332,7 +332,10 @@ static inline char *svc_status(svc_t *svc)
|
|||||||
return "unknown";
|
return "unknown";
|
||||||
|
|
||||||
case SVC_DONE_STATE:
|
case SVC_DONE_STATE:
|
||||||
return "done";
|
if (svc->started)
|
||||||
|
return "done";
|
||||||
|
else
|
||||||
|
return "failed";
|
||||||
|
|
||||||
case SVC_STOPPING_STATE:
|
case SVC_STOPPING_STATE:
|
||||||
switch (svc->type) {
|
switch (svc->type) {
|
||||||
|
|||||||
Reference in new issue
Block a user