- struct exec_task exec_task = {
- .task = {
- .status = "exec",
- .pre_select = exec_pre_select,
- .post_select = exec_post_select,
- },
- };
- struct status_task status_task = {
- .task = {
- .status = "status",
- .pre_select = status_pre_select,
- .post_select = status_post_select,
- },
- .fd = -1
- };
- struct input_task input_task = {
- .task = {
- .status = "input",
- .pre_select = input_pre_select,
- .post_select = input_post_select,
- },
- };
- struct signal_task signal_task = {
- .task = {
- .status = "signal",
- .pre_select = signal_pre_select,
- .post_select = signal_post_select,
- },
- };
- signal_task.fd = para_signal_init();
+
+ exec_task.task = task_register(&(struct task_info) {
+ .name = "exec",
+ .pre_select = exec_pre_select,
+ .post_select = exec_post_select,
+ .context = &exec_task,
+ }, &sched);
+
+ status_task.task = task_register(&(struct task_info) {
+ .name = "status",
+ .pre_select = status_pre_select,
+ .post_select = status_post_select,
+ .context = &status_task,
+ }, &sched);
+
+ input_task.task = task_register(&(struct task_info) {
+ .name = "input",
+ .pre_select = input_pre_select,
+ .post_select = input_post_select,
+ .context = &input_task,
+ }, &sched);
+
+ signal_task = signal_init_or_die();