void
ioset_init(void)
{
- assert(engine == NULL);
+ if (engine) /* someone beat us to it */
+ return;
#if WITH_IOSET_KQUEUE
if (!engine && io_engine_kqueue.init())
log_module(MAIN_LOG, LOG_ERROR, "Somebody called ioset_add(%d) on a negative fd!", fd);
return 0;
}
+ if (!engine)
+ ioset_init();
res = calloc(1, sizeof(*res));
if (!res)
return 0;
return io_fd;
}
+void ioset_update(struct io_fd *fd) {
+ engine->update(fd);
+}
+
static void
ioset_try_write(struct io_fd *fd) {
int res;