aboutsummaryrefslogtreecommitdiff
path: root/mptest/mptest.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2013-04-12 01:04:36 +0000
committerdrh <drh@noemail.net>2013-04-12 01:04:36 +0000
commit739ee7ffac34ef1b93c4560f34dc272d3864f45f (patch)
treecdf7e713683b90f4c937b271abcf96ecf7d27b69 /mptest/mptest.c
parentfdd72c9a2fc9b4f1d3eb256830dc055dcdbad4e0 (diff)
downloadsqlite-739ee7ffac34ef1b93c4560f34dc272d3864f45f.tar.gz
sqlite-739ee7ffac34ef1b93c4560f34dc272d3864f45f.zip
In mptester: improve the way that child processes are dispatched. Pass
the --vfs option through to children. Log the command used to start child processes when the tracing level is high enough. FossilOrigin-Name: 55718ae3462b2b6e0774d49e1c4c74143bc9e3a5
Diffstat (limited to 'mptest/mptest.c')
-rw-r--r--mptest/mptest.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/mptest/mptest.c b/mptest/mptest.c
index 33f4a3fa7..e47be5ae6 100644
--- a/mptest/mptest.c
+++ b/mptest/mptest.c
@@ -48,10 +48,8 @@
/* The suffix to append to the child command lines, if any */
#if defined(_WIN32)
-# define CMDLINE_SUFFIX ""
# define GETPID (int)GetCurrentProcessId
#else
-# define CMDLINE_SUFFIX "&"
# define GETPID getpid
#endif
@@ -629,14 +627,20 @@ static void startClient(int iClient){
if( sqlite3_changes(g.db) ){
char *zSys;
int rc;
- zSys = sqlite3_mprintf(
- "%s \"%s\" --client %d --trace %d %s%s%s",
- g.argv0, g.zDbFile, iClient, g.iTrace,
- g.bSqlTrace ? "--sqltrace " : "",
- g.bSync ? "--sync " : "",
- CMDLINE_SUFFIX
- );
+ zSys = sqlite3_mprintf("%s \"%s\" --client %d --trace %d",
+ g.argv0, g.zDbFile, iClient, g.iTrace);
+ if( g.bSqlTrace ){
+ zSys = sqlite3_mprintf("%z --sqltrace", zSys);
+ }
+ if( g.bSync ){
+ zSys = sqlite3_mprintf("%z --sync", zSys);
+ }
+ if( g.zVfs ){
+ zSys = sqlite3_mprintf("%z --vfs \"%s\"", zSys, g.zVfs);
+ }
+ if( g.iTrace>=2 ) logMessage("system('%q')", zSys);
#if !defined(_WIN32)
+ zSys = sqlite3_mprintf("%z &", zSys);
rc = system(zSys);
if( rc ) errorMessage("system() fails with error code %d", rc);
#else