svn commit: samba r14912 - in branches/SAMBA_4_0/source/ntvfs/sysdep: .

metze at samba.org metze at samba.org
Tue Apr 4 16:58:28 GMT 2006


Author: metze
Date: 2006-04-04 16:58:28 +0000 (Tue, 04 Apr 2006)
New Revision: 14912

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14912

Log:
don't crash if inotify isn't present...

metze
Modified:
   branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.c	2006-04-04 16:23:05 UTC (rev 14911)
+++ branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.c	2006-04-04 16:58:28 UTC (rev 14912)
@@ -44,10 +44,6 @@
 	const char *bname;
 	struct sys_notify_backend *b;
 
-	if (backends == NULL) {
-		return NULL;
-	}
-
 	if (ev == NULL) {
 		ev = event_context_find(mem_ctx);
 	}
@@ -60,16 +56,25 @@
 	ctx->ev = ev;
 
 	bname = lp_parm_string(snum, "notify", "backend");
-	if (bname == NULL) {
-		bname = backends->name;
+	if (!bname) {
+		if (backends) {
+			bname = backends->name;
+		} else {
+			bname = "__unknown__";
+		}
 	}
 
 	for (b=backends;b;b=b->next) {
-		if (strcasecmp(b->name, bname) == 0) break;
+		if (strcasecmp(b->name, bname) == 0) {
+			bname = b->name;
+			break;
+		}
 	}
 
+	ctx->name = bname;
+	ctx->notify_watch = NULL;
+
 	if (b != NULL) {
-		ctx->name = b->name;
 		ctx->notify_watch = b->notify_watch;
 	}
 
@@ -83,6 +88,9 @@
 			  uint32_t filter, sys_notify_callback_t callback,
 			  void *private, void **handle)
 {
+	if (!ctx->notify_watch) {
+		return NT_STATUS_NOT_IMPLEMENTED;
+	}
 	return ctx->notify_watch(ctx, dirpath, filter, callback, private, handle);
 }
 



More information about the samba-cvs mailing list