Fixes to improve portability (especially to OS X, Solaris, OpenBSD).
[ircu2.10.12-pk.git] / ircd / engine_select.c
index f09c7713c5466adaf4d2009d655d5aa9f09c4b8c..eed38567d239be0cee0aa29c174f55a9580c9e8e 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <assert.h>
 #include <errno.h>
+#include <string.h> /* needed for bzero() on OS X */
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/types.h>
@@ -241,7 +242,7 @@ engine_loop(struct Generators* gen)
        /* Log the select error */
        log_write(LS_SOCKET, L_ERROR, 0, "select() error: %m");
        if (!errors++)
-         timer_add(&clear_error, error_clear, 0, TT_PERIODIC,
+         timer_add(timer_init(&clear_error), error_clear, 0, TT_PERIODIC,
                    ERROR_EXPIRE_TIME);
        else if (errors > SELECT_ERROR_THRESHOLD) /* too many errors... */
          server_restart("too many select errors");