diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-02-07 03:16:10 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:44:46 -0500 |
commit | f0fcc332f5b9de7334780a2e522efaa7494ee343 (patch) | |
tree | 8f5f594eb8c8158cde289c0e2932a19b870becfe | |
parent | e5b00e3637b82bc72382e1a5cd75a521c7598743 (diff) | |
download | samba-f0fcc332f5b9de7334780a2e522efaa7494ee343.tar.gz samba-f0fcc332f5b9de7334780a2e522efaa7494ee343.tar.bz2 samba-f0fcc332f5b9de7334780a2e522efaa7494ee343.zip |
r21212: detect if the kernel does not support integrated epoll/aio when the
event context is created. This allows the LOCAL-EVENT test to pass on
systems with have libaio but not the necessary kernel patches
(This used to be commit 2ff8abf0022824e6ae93019ee1b3391e651a8ee7)
-rw-r--r-- | source4/lib/events/events_aio.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/lib/events/events_aio.c b/source4/lib/events/events_aio.c index 90d4bdcc1f..ddadedf6e3 100644 --- a/source4/lib/events/events_aio.c +++ b/source4/lib/events/events_aio.c @@ -324,15 +324,25 @@ static int aio_event_context_init(struct event_context *ev) aio_ev->epoll_iocb = talloc(aio_ev, struct iocb); if (io_queue_init(MAX_AIO_QUEUE_DEPTH, &aio_ev->ioctx) != 0) { + talloc_free(aio_ev); return -1; } aio_ev->epoll_fd = epoll_create(MAX_AIO_QUEUE_DEPTH); - if (aio_ev->epoll_fd == -1) return -1; + if (aio_ev->epoll_fd == -1) { + talloc_free(aio_ev); + return -1; + } talloc_set_destructor(aio_ev, aio_ctx_destructor); ev->additional_data = aio_ev; + + if (setup_epoll_wait(aio_ev) < 0) { + talloc_free(aio_ev); + return -1; + } + return 0; } |