diff options
author | drh <> | 2024-11-17 11:42:43 +0000 |
---|---|---|
committer | drh <> | 2024-11-17 11:42:43 +0000 |
commit | bbc6e5c9b71d3f459557c182a3be34b25319a3bf (patch) | |
tree | 39b02b6ba638f7aa305fae0847f4d977963aaa00 /src | |
parent | f6fdf32553a1be18cebcd9ec93bc21fc95c794f9 (diff) | |
download | sqlite-bbc6e5c9b71d3f459557c182a3be34b25319a3bf.tar.gz sqlite-bbc6e5c9b71d3f459557c182a3be34b25319a3bf.zip |
Make the --vfstrace output from the CLI go to the same output channel as
everything else.
FossilOrigin-Name: f71d4900205ae6ee41f849c4026d0fe4d6cf281dfc3bac8105fc8e242d128b67
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c.in | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/shell.c.in b/src/shell.c.in index 26b6d73de..a6700eb83 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -12701,6 +12701,15 @@ static void sayAbnormalExit(void){ if( seenInterrupt ) eputz("Program interrupted.\n"); } +/* Routine to output from vfstrace +*/ +static int vfstraceOut(const char *z, void *pArg){ + ShellState *p = (ShellState*)pArg; + sqlite3_fputs(z, p->out); + fflush(p->out); + return 1; +} + #ifndef SQLITE_SHELL_IS_UTF8 # if (defined(_WIN32) || defined(WIN32)) \ && (defined(_MSC_VER) || (defined(UNICODE) && defined(__GNUC__))) @@ -12937,8 +12946,6 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ default: sqlite3_config(SQLITE_CONFIG_SERIALIZED); break; } }else if( cli_strcmp(z,"-vfstrace")==0 ){ - vfstrace_register("trace",0,(int(*)(const char*,void*))sqlite3_fputs, - stderr,1); bEnableVfstrace = 1; #ifdef SQLITE_ENABLE_MULTIPLEX }else if( cli_strcmp(z,"-multiplex")==0 ){ @@ -13035,6 +13042,9 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ #endif } data.out = stdout; + if( bEnableVfstrace ){ + vfstrace_register("trace",0,vfstraceOut, &data, 1); + } #ifndef SQLITE_SHELL_FIDDLE sqlite3_appendvfs_init(0,0,0); #endif |