summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/posix/config.m43
-rw-r--r--source4/ntvfs/posix/config.mk2
-rw-r--r--source4/ntvfs/sysdep/inotify.c20
3 files changed, 19 insertions, 6 deletions
diff --git a/source4/ntvfs/posix/config.m4 b/source4/ntvfs/posix/config.m4
index fe1997b437..a6f79dfbb3 100644
--- a/source4/ntvfs/posix/config.m4
+++ b/source4/ntvfs/posix/config.m4
@@ -30,8 +30,7 @@ if test x"$ac_cv_func_ext_blkid_get_cache" = x"yes"; then
SMB_ENABLE(BLKID,YES)
fi
-AC_CHECK_HEADERS(libaio.h)
SMB_ENABLE(pvfs_aio,NO)
-if test x"$ac_cv_header_libaio_h" = x"yes"; then
+if test x"$tevent_cv_aio_support" = x"yes"; then
SMB_ENABLE(pvfs_aio,YES)
fi
diff --git a/source4/ntvfs/posix/config.mk b/source4/ntvfs/posix/config.mk
index ec1cdf3659..1d7949214a 100644
--- a/source4/ntvfs/posix/config.mk
+++ b/source4/ntvfs/posix/config.mk
@@ -29,7 +29,7 @@ pvfs_acl_nfs4_OBJ_FILES = $(ntvfssrcdir)/posix/pvfs_acl_nfs4.o
################################################
[SUBSYSTEM::pvfs_aio]
-PRIVATE_DEPENDENCIES = LIBTEVENT LIBAIO_LINUX
+PRIVATE_DEPENDENCIES = LIBTEVENT LIBTEVENT_EXT
################################################
pvfs_aio_OBJ_FILES = $(ntvfssrcdir)/posix/pvfs_aio.o
diff --git a/source4/ntvfs/sysdep/inotify.c b/source4/ntvfs/sysdep/inotify.c
index f7aa91dd0e..42aac0b097 100644
--- a/source4/ntvfs/sysdep/inotify.c
+++ b/source4/ntvfs/sysdep/inotify.c
@@ -23,8 +23,8 @@
#include "includes.h"
#include "system/filesys.h"
+#include <tevent.h>
#include "ntvfs/sysdep/sys_notify.h"
-#include "lib/events/events.h"
#include "../lib/util/dlinklist.h"
#include "libcli/raw/smb.h"
#include "param/param.h"
@@ -249,8 +249,11 @@ static void inotify_handler(struct tevent_context *ev, struct tevent_fd *fde,
static NTSTATUS inotify_setup(struct sys_notify_context *ctx)
{
struct inotify_private *in;
+ struct tevent_fd *fde;
+
in = talloc(ctx, struct inotify_private);
NT_STATUS_HAVE_NO_MEMORY(in);
+
in->fd = inotify_init();
if (in->fd == -1) {
DEBUG(0,("Failed to init inotify - %s\n", strerror(errno)));
@@ -263,8 +266,19 @@ static NTSTATUS inotify_setup(struct sys_notify_context *ctx)
ctx->private_data = in;
/* add a event waiting for the inotify fd to be readable */
- event_add_fd(ctx->ev, in, in->fd, EVENT_FD_READ|EVENT_FD_AUTOCLOSE, inotify_handler, in);
-
+ fde = tevent_add_fd(ctx->ev, in, in->fd,
+ TEVENT_FD_READ, inotify_handler, in);
+ if (!fde) {
+ if (errno == 0) {
+ errno = ENOMEM;
+ }
+ DEBUG(0,("Failed to tevent_add_fd() - %s\n", strerror(errno)));
+ talloc_free(in);
+ return map_nt_error_from_unix(errno);
+ }
+
+ tevent_fd_set_auto_close(fde);
+
return NT_STATUS_OK;
}