mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 22:13:01 +07:00
Merge pull request #207 from liuming50/set-condition-done-for-oneshot-tasks
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -1705,6 +1705,21 @@ static void svc_set_state(svc_t *svc, svc_state_t new)
|
||||
service_timeout_cancel(svc);
|
||||
service_timeout_after(svc, svc->killdelay, service_kill);
|
||||
}
|
||||
|
||||
if (svc_is_runtask(svc)) {
|
||||
char cond[MAX_COND_LEN];
|
||||
|
||||
snprintf(cond, sizeof(cond), "%s/%s/done", svc->type, svc->name);
|
||||
|
||||
/* create done condition when entering SVC_DONE_STATE. */
|
||||
if (*state == SVC_DONE_STATE)
|
||||
cond_set_oneshot(cond);
|
||||
|
||||
/* clear done condition when entering SVC_HALTED_STATE. */
|
||||
if (*state == SVC_HALTED_STATE)
|
||||
cond_clear(cond);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user