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

metze at samba.org metze at samba.org
Sun Jan 9 02:33:17 GMT 2005


Author: metze
Date: 2005-01-09 02:33:16 +0000 (Sun, 09 Jan 2005)
New Revision: 4608

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

Log:
- use better error codes
- use new NT_STATUS_* macros for error checking return
- don't use talloc_p anymore

metze

Modified:
   branches/SAMBA_4_0/source/ntvfs/ntvfs_base.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/ntvfs_base.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/ntvfs_base.c	2005-01-09 02:30:01 UTC (rev 4607)
+++ branches/SAMBA_4_0/source/ntvfs/ntvfs_base.c	2005-01-09 02:33:16 UTC (rev 4608)
@@ -126,37 +126,32 @@
 	struct ntvfs_context *ctx;
 
 	if (!handlers) {
-		return NT_STATUS_FOOBAR;
+		return NT_STATUS_INTERNAL_ERROR;
 	}
 
-	ctx = talloc_p(req->tcon, struct ntvfs_context);
-	if (!ctx) {
-		return NT_STATUS_NO_MEMORY;
-	}
+	ctx = talloc(req->tcon, struct ntvfs_context);
+	NT_STATUS_HAVE_NO_MEMORY(ctx);
 	ctx->type = type;
 	ctx->modules = NULL;
 
 	for (i=0; handlers[i]; i++) {
 		struct ntvfs_module_context *ntvfs;
 
-		ntvfs = talloc_p(ctx, struct ntvfs_module_context);
-		if (!ntvfs) {
-			return NT_STATUS_NO_MEMORY;
-		}
+		ntvfs = talloc(ctx, struct ntvfs_module_context);
+		NT_STATUS_HAVE_NO_MEMORY(ntvfs);
 
 		ntvfs->ops = ntvfs_backend_byname(handlers[i], ctx->type);
 		if (!ntvfs->ops) {
 			DEBUG(1,("ntvfs_init_connection: failed to find backend=%s, type=%d\n",
 				handlers[i], ctx->type));
-			return NT_STATUS_UNSUCCESSFUL;
+			return NT_STATUS_INTERNAL_ERROR;
 		}
 		ntvfs->depth = i;
 		DLIST_ADD_END(ctx->modules, ntvfs, struct ntvfs_module_context *);
 	}
 
 	if (!ctx->modules) {
-		talloc_free(ctx);
-		return NT_STATUS_FOOBAR;
+		return NT_STATUS_INTERNAL_ERROR;
 	}
 
 	req->tcon->ntvfs_ctx = ctx;



More information about the samba-cvs mailing list