summaryrefslogtreecommitdiff
path: root/source4/lib/events
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/events')
-rw-r--r--source4/lib/events/config.mk10
-rw-r--r--source4/lib/events/events.c13
-rw-r--r--source4/lib/events/events_aio.c3
3 files changed, 19 insertions, 7 deletions
diff --git a/source4/lib/events/config.mk b/source4/lib/events/config.mk
index 5e871cb0ac..5112ba313b 100644
--- a/source4/lib/events/config.mk
+++ b/source4/lib/events/config.mk
@@ -1,4 +1,12 @@
##############################
+[MODULE::EVENTS_AIO]
+OBJ_FILES = events_aio.o
+PRIVATE_DEPENDENCIES = LIBAIO_LINUX
+SUBSYSTEM = LIBEVENTS
+INIT_FUNCTION = events_aio_init
+##############################
+
+##############################
[MODULE::EVENTS_EPOLL]
OBJ_FILES = events_epoll.o
SUBSYSTEM = LIBEVENTS
@@ -24,6 +32,6 @@ INIT_FUNCTION = events_standard_init
# Start SUBSYSTEM LIBEVENTS
[SUBSYSTEM::LIBEVENTS]
OBJ_FILES = events.o events_timed.o
-PUBLIC_DEPENDENCIES = LIBTALLOC EVENTS_STANDARD EVENTS_EPOLL
+PUBLIC_DEPENDENCIES = LIBTALLOC EVENTS_STANDARD EVENTS_AIO EVENTS_EPOLL
# End SUBSYSTEM LIBEVENTS
##############################
diff --git a/source4/lib/events/events.c b/source4/lib/events/events.c
index 52b431befa..11f85b1c6e 100644
--- a/source4/lib/events/events.c
+++ b/source4/lib/events/events.c
@@ -157,6 +157,10 @@ struct event_context *event_context_init_byname(TALLOC_CTX *mem_ctx, const char
event_backend_init();
+ if (name == NULL) {
+ name = "standard";
+ }
+
for (e=event_backends;e;e=e->next) {
if (strcmp(name, e->name) == 0) {
return event_context_init_ops(mem_ctx, e->ops);
@@ -173,7 +177,7 @@ struct event_context *event_context_init_byname(TALLOC_CTX *mem_ctx, const char
*/
struct event_context *event_context_init(TALLOC_CTX *mem_ctx)
{
- return event_context_init_byname(mem_ctx, "standard");
+ return event_context_init_byname(mem_ctx, NULL);
}
/*
@@ -246,6 +250,7 @@ int event_loop_wait(struct event_context *ev)
return ev->ops->loop_wait(ev);
}
+#if _SAMBA_BUILD_
/*
find an event context that is a parent of the given memory context,
or create a new event context as a child of the given context if
@@ -258,8 +263,10 @@ int event_loop_wait(struct event_context *ev)
struct event_context *event_context_find(TALLOC_CTX *mem_ctx)
{
struct event_context *ev = talloc_find_parent_bytype(mem_ctx, struct event_context);
- if (ev == NULL) {
- ev = event_context_init(mem_ctx);
+ if (ev == NULL) {
+ ev = event_context_init_byname(mem_ctx,
+ lp_parm_string(-1, "event", "backend"));
}
return ev;
}
+#endif
diff --git a/source4/lib/events/events_aio.c b/source4/lib/events/events_aio.c
index 1c2735c200..52ddadfc52 100644
--- a/source4/lib/events/events_aio.c
+++ b/source4/lib/events/events_aio.c
@@ -268,9 +268,6 @@ static int aio_event_loop(struct aio_event_context *aio_ev, struct timeval *tval
uint16_t flags = 0;
int j;
-// DEBUG(0,("EVENT finished=%p fde=%p ep=%p\n", finished, fde, ep));
- //printf("GOT %d aio epoll events\n", event->res);
-
aio_ev->is_epoll_set = 0;
for (j=0; j<event->res; j++, ep++) {