1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

In the Win32 VFS, when truncating a file, unmap it first.

FossilOrigin-Name: 21510a66dce4d0843ccfe20f092a01f5a52563ef244a94f1d5d2563305cab925
This commit is contained in:
mistachkin
2018-07-22 06:25:35 +00:00
parent 9676e611b6
commit 1e8487db29
7 changed files with 108 additions and 23 deletions

View File

@@ -60,6 +60,7 @@
/* Used to get the current process ID */
#if !defined(_WIN32)
# include <signal.h>
# include <unistd.h>
# define GETPID getpid
#elif !defined(_WIN32_WCE)
@@ -69,6 +70,8 @@
# endif
# include <windows.h>
# endif
# include <io.h>
# define isatty(h) _isatty(h)
# define GETPID (int)GetCurrentProcessId
#endif
@@ -3733,11 +3736,19 @@ int SQLITE_CDECL TCLSH_MAIN(int argc, char **argv){
#endif
#if !defined(_WIN32_WCE)
if( getenv("BREAK") ){
fprintf(stderr,
"attach debugger to process %d and press any key to continue.\n",
GETPID());
fgetc(stdin);
if( getenv("SQLITE_DEBUG_BREAK") ){
if( isatty(0) && isatty(2) ){
fprintf(stderr,
"attach debugger to process %d and press any key to continue.\n",
GETPID());
fgetc(stdin);
}else{
#if defined(_WIN32) || defined(WIN32)
DebugBreak();
#elif defined(SIGTRAP)
raise(SIGTRAP);
#endif
}
}
#endif