summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-10-29 14:19:32 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-11-02 04:36:04 +0000
commit9da4ace1d9789d300ab298bc34694c44b2062f30 (patch)
tree0c4ce1fa4f3a97934c9504263fdfc86a28e39705 /source3/torture
parent4ae27891f8ac0a56d68b0544e78d6c17ade0c1c9 (diff)
downloadsamba-9da4ace1d9789d300ab298bc34694c44b2062f30.tar.gz
samba-9da4ace1d9789d300ab298bc34694c44b2062f30.tar.bz2
samba-9da4ace1d9789d300ab298bc34694c44b2062f30.zip
s3-debug Impove setup_logging() to specify logging to stderr
This change improves the setup_logging() API so that callers which wish to set up logging to stderr can simply ask for it, rather than directly modify the dbf global variable. Andrew Bartlett
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/locktest.c4
-rw-r--r--source3/torture/locktest2.c6
-rw-r--r--source3/torture/masktest.c4
-rw-r--r--source3/torture/msgtest.c2
-rw-r--r--source3/torture/pdbtest.c2
-rw-r--r--source3/torture/smbiconv.c2
-rw-r--r--source3/torture/torture.c6
-rw-r--r--source3/torture/vfstest.c2
8 files changed, 10 insertions, 18 deletions
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c
index a90c2e2dfe..9c8c6965b1 100644
--- a/source3/torture/locktest.c
+++ b/source3/torture/locktest.c
@@ -604,14 +604,12 @@ static void usage(void)
load_case_tables();
- dbf = x_stderr;
-
if (argc < 3 || argv[1][0] == '-') {
usage();
exit(1);
}
- setup_logging(argv[0],True);
+ setup_logging(argv[0], DEBUG_STDOUT);
for (server=0;server<NSERVERS;server++) {
share[server] = argv[1+server];
diff --git a/source3/torture/locktest2.c b/source3/torture/locktest2.c
index 5c8a2d8019..033fe123ad 100644
--- a/source3/torture/locktest2.c
+++ b/source3/torture/locktest2.c
@@ -491,13 +491,13 @@ static void usage(void)
setlinebuf(stdout);
- dbf = x_stderr;
-
if (argc < 5 || argv[1][0] == '-') {
usage();
exit(1);
}
+ setup_logging(argv[0], DEBUG_STDOUT);
+
share1 = argv[1];
share2 = argv[2];
nfspath1 = argv[3];
@@ -506,8 +506,6 @@ static void usage(void)
all_string_sub(share1,"/","\\",0);
all_string_sub(share2,"/","\\",0);
- setup_logging(argv[0],True);
-
argc -= 4;
argv += 4;
diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c
index 82aa6bff36..b8bcb4ade0 100644
--- a/source3/torture/masktest.c
+++ b/source3/torture/masktest.c
@@ -484,8 +484,6 @@ static void usage(void)
setlinebuf(stdout);
- dbf = x_stderr;
-
DEBUGLEVEL = 0;
AllowDebugChange = False;
@@ -498,7 +496,7 @@ static void usage(void)
all_string_sub(share,"/","\\",0);
- setup_logging(argv[0],True);
+ setup_logging(argv[0], DEBUG_STDERR);
argc -= 1;
argv += 1;
diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c
index 6d1a689772..adb45f75e3 100644
--- a/source3/torture/msgtest.c
+++ b/source3/torture/msgtest.c
@@ -49,7 +49,7 @@ static void pong_message(struct messaging_context *msg_ctx,
load_case_tables();
- setup_logging(argv[0],True);
+ setup_logging(argv[0], DEBUG_STDOUT);
lp_load(get_dyn_CONFIGFILE(),False,False,False,True);
diff --git a/source3/torture/pdbtest.c b/source3/torture/pdbtest.c
index 6745ab0f7d..82f8132797 100644
--- a/source3/torture/pdbtest.c
+++ b/source3/torture/pdbtest.c
@@ -259,7 +259,7 @@ int main(int argc, char **argv)
/* Load configuration */
lp_load(get_dyn_CONFIGFILE(), False, False, True, True);
- setup_logging("pdbtest", True);
+ setup_logging("pdbtest", DEBUG_STDOUT);
if (backend == NULL) {
backend = lp_passdb_backend();
diff --git a/source3/torture/smbiconv.c b/source3/torture/smbiconv.c
index d5d580c30b..0ba796d968 100644
--- a/source3/torture/smbiconv.c
+++ b/source3/torture/smbiconv.c
@@ -201,7 +201,7 @@ int main(int argc, char *argv[])
/* the following functions are part of the Samba debugging
facilities. See lib/debug.c */
- setup_logging("smbiconv", True);
+ setup_logging("smbiconv", DEBUG_STDOUT);
if (preload_modules[0]) smb_load_modules(preload_modules);
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 57db3d47b7..bc4b58be73 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -7937,15 +7937,13 @@ static void usage(void)
TALLOC_CTX *frame = talloc_stackframe();
int seed = time(NULL);
- dbf = x_stdout;
-
#ifdef HAVE_SETBUFFER
setbuffer(stdout, NULL, 0);
#endif
- load_case_tables();
+ setup_logging("smbtorture", DEBUG_STDOUT);
- setup_logging("smbtorture", true);
+ load_case_tables();
if (is_default_dyn_CONFIGFILE()) {
if(getenv("SMB_CONF_PATH")) {
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 76025eef1f..3b0ec54564 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -462,7 +462,7 @@ int main(int argc, char *argv[])
/* the following functions are part of the Samba debugging
facilities. See lib/debug.c */
- setup_logging("vfstest", True);
+ setup_logging("vfstest", DEBUG_STDOUT);
/* Load command lists */