summaryrefslogtreecommitdiff
path: root/source4/ntvfs/ntvfs_base.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-01-09 02:33:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:33 -0500
commitc13ada4e35a3ad68950a19a981499acebb521128 (patch)
tree3192306d4c070224716927ac9ceb6a5e5e4649ce /source4/ntvfs/ntvfs_base.c
parente0b0d934ec5894bb9833c3b93d1d103778aa81fa (diff)
downloadsamba-c13ada4e35a3ad68950a19a981499acebb521128.tar.gz
samba-c13ada4e35a3ad68950a19a981499acebb521128.tar.bz2
samba-c13ada4e35a3ad68950a19a981499acebb521128.zip
r4608: - use better error codes
- use new NT_STATUS_* macros for error checking return - don't use talloc_p anymore metze (This used to be commit 372a8eeeefc2ebff50211985372888b5b6d4eb65)
Diffstat (limited to 'source4/ntvfs/ntvfs_base.c')
-rw-r--r--source4/ntvfs/ntvfs_base.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c
index ca6fbf0de8..b8aeed419c 100644
--- a/source4/ntvfs/ntvfs_base.c
+++ b/source4/ntvfs/ntvfs_base.c
@@ -126,37 +126,32 @@ NTSTATUS ntvfs_init_connection(struct smbsrv_request *req, enum ntvfs_type type)
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;