service.c: fix a regression

A regression was introduced by commit f0f358a1:
[ service.c: set/clear condition 'done' for run tasks ]

svc->type is a integer but mistakenly being used as string, which will
cause crash.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
This commit is contained in:
Ming Liu
2022-02-07 11:15:47 +01:00
parent 6ec1ab3d4f
commit 885808c64c
+1 -1
View File
@@ -1709,7 +1709,7 @@ static void svc_set_state(svc_t *svc, svc_state_t new)
if (svc_is_runtask(svc)) {
char cond[MAX_COND_LEN];
snprintf(cond, sizeof(cond), "%s/%s/done", svc->type, svc->name);
snprintf(cond, sizeof(cond), "%s/%s/done", svc_typestr(svc), svc->name);
/* create done condition when entering SVC_DONE_STATE. */
if (*state == SVC_DONE_STATE)