ret2 = for_each_stat_item(st->buf, st->loaded, update_item);
if (ret < 0 || ret2 < 0) {
st->loaded = 0;
- PARA_NOTICE_LOG("closing stat pipe: %s\n", para_strerror(-ret));
+ PARA_NOTICE_LOG("closing stat pipe: %s\n",
+ para_strerror(ret < 0? -ret : -ret2));
close(st->fd);
st->fd = -1;
clear_all_items();
static int setup_tasks_and_schedule(void)
{
+ int ret;
struct exec_task exec_task = {.task = NULL};
struct status_task status_task = {.fd = -1};
struct input_task input_task = {.task = NULL};
.post_select = signal_post_select,
.context = &signal_task,
}, &sched);
- return schedule(&sched);
+ ret = schedule(&sched);
+ sched_shutdown(&sched);
+ return ret;
}
/**