Include events_util.h in events_aio.c
[metze/samba/wip.git] / source / lib / events / events_aio.c
index a0417384e0b1bdc196e70fa0a1737dee98771b2c..e30213acbc71d540ef162878c3438909f81a4fda 100644 (file)
   this is _very_ experimental code
 */
 
-#include "includes.h"
 #include "system/filesys.h"
-#include "system/network.h"
-#include "lib/util/dlinklist.h"
-#include "lib/events/events.h"
-#include "lib/events/events_internal.h"
+#include "replace.h"
+#include "events.h"
+#include "events_internal.h"
+#include "events_util.h"
 #include <sys/epoll.h>
 #include <libaio.h>
 
@@ -114,7 +113,7 @@ static void epoll_check_reopen(struct aio_event_context *aio_ev)
        close(aio_ev->epoll_fd);
        aio_ev->epoll_fd = epoll_create(MAX_AIO_QUEUE_DEPTH);
        if (aio_ev->epoll_fd == -1) {
-               DEBUG(0,("Failed to recreate epoll handle after fork\n"));
+               ev_debug(aio_ev->ev, EV_DEBUG_FATAL, "Failed to recreate epoll handle after fork\n");
                return;
        }
        aio_ev->pid = getpid();
@@ -140,7 +139,7 @@ static void epoll_add_event(struct aio_event_context *aio_ev, struct fd_event *f
        /* if we don't want events yet, don't add an aio_event */
        if (fde->flags == 0) return;
 
-       ZERO_STRUCT(event);
+       memset(&event, 0, sizeof(event));
        event.events = epoll_map_flags(fde->flags);
        event.data.ptr = fde;
        epoll_ctl(aio_ev->epoll_fd, EPOLL_CTL_ADD, fde->fd, &event);
@@ -481,7 +480,7 @@ static int aio_event_loop_once(struct event_context *ev)
        struct timeval tval;
 
        tval = common_event_loop_timer_delay(ev);
-       if (timeval_is_zero(&tval)) {
+       if (ev_timeval_is_zero(&tval)) {
                return 0;
        }
 
@@ -566,12 +565,3 @@ bool events_aio_init(void)
        return event_register_backend("aio", &aio_event_ops);
 }
 
-#if _SAMBA_BUILD_
-NTSTATUS s4_events_aio_init(void)
-{
-       if (!events_aio_init()) {
-               return NT_STATUS_INTERNAL_ERROR;
-       }
-       return NT_STATUS_OK;
-}
-#endif