--- mqtt/src/mqttd.c 2011/11/30 01:06:30 1.1.1.1.2.6 +++ mqtt/src/mqttd.c 2011/12/01 00:10:18 1.1.1.1.2.7 @@ -5,6 +5,7 @@ sl_config cfg; +sched_root_task_t *root; extern char compiled[], compiledby[], compilehost[]; int Verbose; @@ -129,8 +130,15 @@ main(int argc, char **argv) else VERB(1) printf("Start service in batch mode ...\n"); - Run(); + if (!(root = schedBegin())) { + printf("Error:: scheduler #%d - %s\n", sched_GetErrno(), sched_GetError()); + ret = 6; + goto end; + } + Run(sock); + + schedEnd(&root); end: if (sock > STDERR_FILENO) srv_Close(sock);