summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-11-19 14:41:42 +0000
committerJeremy Allison <jra@samba.org>2014-12-07 02:37:04 +0100
commit49e208c2b34616d4308e0a3fcf3029c72ee7059f (patch)
tree4cbfbb32e48938f4ebb4289fb9a5e83c8e5c1c59
parentb322ea2059604ed94aa2170e634a59cdb4561681 (diff)
downloadsamba-49e208c2b34616d4308e0a3fcf3029c72ee7059f.tar.gz
samba-49e208c2b34616d4308e0a3fcf3029c72ee7059f.tar.xz
samba-49e208c2b34616d4308e0a3fcf3029c72ee7059f.zip
smbd: Use read_data() in notify_inotify
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sun Dec 7 02:37:04 CET 2014 on sn-devel-104
-rw-r--r--source3/smbd/notify_inotify.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/smbd/notify_inotify.c b/source3/smbd/notify_inotify.c
index a9b7131ef7..5fbc7f22ee 100644
--- a/source3/smbd/notify_inotify.c
+++ b/source3/smbd/notify_inotify.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "../librpc/gen_ndr/notify.h"
#include "smbd/smbd.h"
+#include "lib/sys_rw_data.h"
#ifdef HAVE_INOTIFY
@@ -201,7 +202,7 @@ static void inotify_handler(struct tevent_context *ev, struct tevent_fd *fde,
struct inotify_event *e0, *e;
uint32_t prev_cookie=0;
int prev_wd = -1;
- NTSTATUS status;
+ ssize_t ret;
/*
we must use FIONREAD as we cannot predict the length of the
@@ -219,10 +220,10 @@ static void inotify_handler(struct tevent_context *ev, struct tevent_fd *fde,
if (e == NULL) return;
((uint8_t *)e)[bufsize] = '\0';
- status = read_data_ntstatus(in->fd, (char *)e0, bufsize);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0,("Failed to read all inotify data - %s\n",
- nt_errstr(status)));
+ ret = read_data(in->fd, e0, bufsize);
+ if (ret != bufsize) {
+ DEBUG(0, ("Failed to read all inotify data - %s\n",
+ strerror(errno)));
talloc_free(e0);
/* the inotify fd will now be out of sync,
* can't keep reading data off it */