summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_wait.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-03-29 13:31:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:59:18 -0500
commit57bde8631fc65f9b8e10eee7f948e5690412bead (patch)
tree73b7545405cf4c70a8de5bc15f1dfd0876a6d15d /source4/ntvfs/posix/pvfs_wait.c
parenta339d748ebfdeb1d39b4611c5e8e179f16bbc004 (diff)
downloadsamba-57bde8631fc65f9b8e10eee7f948e5690412bead.tar.gz
samba-57bde8631fc65f9b8e10eee7f948e5690412bead.tar.bz2
samba-57bde8631fc65f9b8e10eee7f948e5690412bead.zip
r14755: the change notify code now passes most of the RAW-NOTIFY test. Still
more work to do though (This used to be commit 4d234b37e528137b5c00f6bbb84c2d6939fea324)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_wait.c')
-rw-r--r--source4/ntvfs/posix/pvfs_wait.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source4/ntvfs/posix/pvfs_wait.c b/source4/ntvfs/posix/pvfs_wait.c
index 2d7e41c247..5750c0fe08 100644
--- a/source4/ntvfs/posix/pvfs_wait.c
+++ b/source4/ntvfs/posix/pvfs_wait.c
@@ -105,7 +105,9 @@ static void pvfs_wait_timeout(struct event_context *ev,
static int pvfs_wait_destructor(void *ptr)
{
struct pvfs_wait *pwait = ptr;
- messaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait);
+ if (pwait->msg_type != -1) {
+ messaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait);
+ }
DLIST_REMOVE(pwait->pvfs->wait_list, pwait);
return 0;
}
@@ -116,6 +118,9 @@ static int pvfs_wait_destructor(void *ptr)
the return value is a handle. To stop waiting talloc_free this
handle.
+
+ if msg_type == -1 then no message is registered, and it is assumed
+ that the caller handles any messaging setup needed
*/
void *pvfs_wait_message(struct pvfs_state *pvfs,
struct ntvfs_request *req,
@@ -146,10 +151,12 @@ void *pvfs_wait_message(struct pvfs_state *pvfs,
/* register with the messaging subsystem for this message
type */
- messaging_register(pwait->msg_ctx,
- pwait,
- msg_type,
- pvfs_wait_dispatch);
+ if (msg_type != -1) {
+ messaging_register(pwait->msg_ctx,
+ pwait,
+ msg_type,
+ pvfs_wait_dispatch);
+ }
/* tell the main smb server layer that we will be replying
asynchronously */