summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2002-08-29 11:17:14 +0000
committerJelmer Vernooij <jelmer@samba.org>2002-08-29 11:17:14 +0000
commit88f8ccd2b25151004dfd9c06a98ddc87066428df (patch)
treebc5d9a1d29d2d36666eb402608e075808616f8ad /source3/torture
parenta97a6ed43add0bb98c205ead3b4343a382d898d5 (diff)
downloadsamba-88f8ccd2b25151004dfd9c06a98ddc87066428df.tar.gz
samba-88f8ccd2b25151004dfd9c06a98ddc87066428df.tar.bz2
samba-88f8ccd2b25151004dfd9c06a98ddc87066428df.zip
Don't use global memory context
(This used to be commit b1e1d548031f270dd51ffa1910c3ae2503e64e8f)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/samtest.c1
-rw-r--r--source3/torture/vfstest.c17
2 files changed, 8 insertions, 10 deletions
diff --git a/source3/torture/samtest.c b/source3/torture/samtest.c
index 94c7fa9c07..15caf8820f 100644
--- a/source3/torture/samtest.c
+++ b/source3/torture/samtest.c
@@ -4,6 +4,7 @@
Copyright (C) 2002 Jelmer Vernooij
+ Parts of the code stolen from vfstest by Simo Sorce and Eric Lorimer
Parts of the code stolen from rpcclient by Tim Potter
This program is free software; you can redistribute it and/or modify
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 3c67fa4633..2186e28cdf 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -33,11 +33,7 @@ static struct cmd_list {
struct cmd_set *cmd_set;
} *cmd_list;
-TALLOC_CTX *global_ctx;
-
extern pstring user_socket_options;
-extern SIG_ATOMIC_T got_sig_term;
-extern SIG_ATOMIC_T reload_after_sighup;
/****************************************************************************
handle completion of commands for readline
@@ -204,8 +200,8 @@ static NTSTATUS cmd_debuglevel(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
static NTSTATUS cmd_freemem(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, char **argv)
{
/* Cleanup */
- talloc_destroy(global_ctx);
- global_ctx = NULL;
+ talloc_destroy(mem_ctx);
+ mem_ctx = NULL;
vfs->data = NULL;
vfs->data_size = 0;
return NT_STATUS_OK;
@@ -214,7 +210,7 @@ static NTSTATUS cmd_freemem(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc
static NTSTATUS cmd_quit(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, char **argv)
{
/* Cleanup */
- talloc_destroy(global_ctx);
+ talloc_destroy(mem_ctx);
exit(0);
return NT_STATUS_OK; /* NOTREACHED */
@@ -268,6 +264,7 @@ static NTSTATUS do_cmd(struct vfs_state *vfs, struct cmd_set *cmd_entry, char *c
char *p = cmd, **argv = NULL;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
pstring buf;
+ TALLOC_CTX *mem_ctx;
int argc = 0, i;
/* Count number of arguments first time through the loop then
@@ -305,16 +302,16 @@ static NTSTATUS do_cmd(struct vfs_state *vfs, struct cmd_set *cmd_entry, char *c
if (cmd_entry->fn) {
- if (global_ctx == NULL) {
+ if (mem_ctx == NULL) {
/* Create mem_ctx */
- if (!(global_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init())) {
DEBUG(0, ("talloc_init() failed\n"));
goto done;
}
}
/* Run command */
- result = cmd_entry->fn(vfs, global_ctx, argc, argv);
+ result = cmd_entry->fn(vfs, mem_ctx, argc, argv);
} else {
fprintf (stderr, "Invalid command\n");