--- mqtt/src/daemon.c 2012/05/03 13:39:34 1.2.2.20 +++ mqtt/src/daemon.c 2012/05/03 15:05:37 1.2.2.22 @@ -336,7 +336,7 @@ acceptClient(sched_task_t *task) if ((cli = accept(TASK_FD(task), &sa.sa, &sslen)) == -1) goto end; else - fcntl(TASK_FD(task), F_SETFL, fcntl(TASK_FD(task), F_GETFL, 0) | O_NONBLOCK); + fcntl(cli, F_SETFL, fcntl(cli, F_GETFL, 0) | O_NONBLOCK); v = io_allocVar(); if (!v) { @@ -357,7 +357,7 @@ acceptClient(sched_task_t *task) ioDEBUG(1, "Terminated client with socket=%d", cli); } end: - if (!schedRead(TASK_ROOT(task), acceptClient, NULL, TASK_FD(task), NULL, 0)) + if (!schedRead(root, acceptClient, NULL, TASK_FD(task), NULL, 0)) ioLIBERR(sched); return NULL; }