mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-15 11:41:13 +03:00
Limit the number of memset() calls used when determining a temporary file name on Windows. Also, fix a harmless compiler warning.
FossilOrigin-Name: 136fc2931b156f91cdd76a7a009298cdf09d826a
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Slight\smodifications\sto\spath\sname\stranslation\shandling\sfor\sCygwin.
|
C Limit\sthe\snumber\sof\smemset()\scalls\sused\swhen\sdetermining\sa\stemporary\sfile\sname\son\sWindows.\s\sAlso,\sfix\sa\sharmless\scompiler\swarning.
|
||||||
D 2013-07-31T22:39:26.505
|
D 2013-07-31T23:28:36.603
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
|
F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@@ -203,7 +203,7 @@ F src/os.c b4ad71336fd96f97776f75587cd9e8218288f5be
|
|||||||
F src/os.h 4a46270a64e9193af4a0aaa3bc2c66dc07c29b3f
|
F src/os.h 4a46270a64e9193af4a0aaa3bc2c66dc07c29b3f
|
||||||
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
|
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
|
||||||
F src/os_unix.c 9eafa5458cf2ff684ddccff82c9bb113c7cad847
|
F src/os_unix.c 9eafa5458cf2ff684ddccff82c9bb113c7cad847
|
||||||
F src/os_win.c 3a74943b286746533963579337b1de4383cf963b
|
F src/os_win.c 1d84f2079d9b91f91a4b5dbfa5e08f1b1a0ed0ff
|
||||||
F src/pager.c 5d2f7475260a8588f9c441bb309d2b7eaa7ded3b
|
F src/pager.c 5d2f7475260a8588f9c441bb309d2b7eaa7ded3b
|
||||||
F src/pager.h 5cb78b8e1adfd5451e600be7719f5a99d87ac3b1
|
F src/pager.h 5cb78b8e1adfd5451e600be7719f5a99d87ac3b1
|
||||||
F src/parse.y 9acfcc83ddbf0cf82f0ed9582ccf0ad6c366ff37
|
F src/parse.y 9acfcc83ddbf0cf82f0ed9582ccf0ad6c366ff37
|
||||||
@@ -1103,7 +1103,7 @@ F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
|||||||
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
||||||
F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae
|
F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae
|
||||||
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
|
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
|
||||||
P c93d891b03c626b9ed01ed5ef2f246b2d4a40a64
|
P 33ba1f4c5dc2ef8292adf17a32ade0cde0887d88
|
||||||
R 1da5a28da1b68405b6ad12dd77b7c1d9
|
R 22ac6c086833ea6790806cfd601e6a5b
|
||||||
U mistachkin
|
U mistachkin
|
||||||
Z 86b10e2366b2108534452cce8a04325b
|
Z 4d19b2638b72ab835325f17f2f967fc6
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
33ba1f4c5dc2ef8292adf17a32ade0cde0887d88
|
136fc2931b156f91cdd76a7a009298cdf09d826a
|
||||||
29
src/os_win.c
29
src/os_win.c
@@ -3696,10 +3696,10 @@ static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
|
|||||||
return SQLITE_OK;
|
return SQLITE_OK;
|
||||||
}
|
}
|
||||||
assert( (nMap % winSysInfo.dwPageSize)==0 );
|
assert( (nMap % winSysInfo.dwPageSize)==0 );
|
||||||
#if SQLITE_OS_WINRT
|
|
||||||
pNew = osMapViewOfFileFromApp(pFd->hMap, flags, 0, nMap);
|
|
||||||
#else
|
|
||||||
assert( sizeof(SIZE_T)==sizeof(sqlite3_int64) || nMap<=0xffffffff );
|
assert( sizeof(SIZE_T)==sizeof(sqlite3_int64) || nMap<=0xffffffff );
|
||||||
|
#if SQLITE_OS_WINRT
|
||||||
|
pNew = osMapViewOfFileFromApp(pFd->hMap, flags, 0, (SIZE_T)nMap);
|
||||||
|
#else
|
||||||
pNew = osMapViewOfFile(pFd->hMap, flags, 0, 0, (SIZE_T)nMap);
|
pNew = osMapViewOfFile(pFd->hMap, flags, 0, 0, (SIZE_T)nMap);
|
||||||
#endif
|
#endif
|
||||||
if( pNew==NULL ){
|
if( pNew==NULL ){
|
||||||
@@ -3896,8 +3896,6 @@ static int getTempname(int nBuf, char *zBuf){
|
|||||||
*/
|
*/
|
||||||
SimulateIOError( return SQLITE_IOERR );
|
SimulateIOError( return SQLITE_IOERR );
|
||||||
|
|
||||||
memset(zTempPath, 0, SQLITE_WIN32_MAX_PATH+2);
|
|
||||||
|
|
||||||
if( sqlite3_temp_directory ){
|
if( sqlite3_temp_directory ){
|
||||||
sqlite3_snprintf(SQLITE_WIN32_MAX_PATH-30, zTempPath, "%s",
|
sqlite3_snprintf(SQLITE_WIN32_MAX_PATH-30, zTempPath, "%s",
|
||||||
sqlite3_temp_directory);
|
sqlite3_temp_directory);
|
||||||
@@ -3936,8 +3934,24 @@ static int getTempname(int nBuf, char *zBuf){
|
|||||||
return SQLITE_IOERR_NOMEM;
|
return SQLITE_IOERR_NOMEM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#else
|
||||||
#endif
|
else{
|
||||||
|
/*
|
||||||
|
** Compiled without ANSI support and the current operating system
|
||||||
|
** is not Windows NT; therefore, just zero the temporary buffer.
|
||||||
|
*/
|
||||||
|
memset(zTempPath, 0, SQLITE_WIN32_MAX_PATH+2);
|
||||||
|
}
|
||||||
|
#endif /* SQLITE_WIN32_HAS_ANSI */
|
||||||
|
#else
|
||||||
|
else{
|
||||||
|
/*
|
||||||
|
** Compiled for WinRT and the sqlite3_temp_directory is not set;
|
||||||
|
** therefore, just zero the temporary buffer.
|
||||||
|
*/
|
||||||
|
memset(zTempPath, 0, SQLITE_WIN32_MAX_PATH+2);
|
||||||
|
}
|
||||||
|
#endif /* !SQLITE_OS_WINRT */
|
||||||
|
|
||||||
/* Check that the output buffer is large enough for the temporary file
|
/* Check that the output buffer is large enough for the temporary file
|
||||||
** name. If it is not, return SQLITE_ERROR.
|
** name. If it is not, return SQLITE_ERROR.
|
||||||
@@ -4089,7 +4103,6 @@ static int winOpen(
|
|||||||
*/
|
*/
|
||||||
if( !zUtf8Name ){
|
if( !zUtf8Name ){
|
||||||
assert(isDelete && !isOpenJournal);
|
assert(isDelete && !isOpenJournal);
|
||||||
memset(zTmpname, 0, SQLITE_WIN32_MAX_PATH+2);
|
|
||||||
rc = getTempname(SQLITE_WIN32_MAX_PATH+2, zTmpname);
|
rc = getTempname(SQLITE_WIN32_MAX_PATH+2, zTmpname);
|
||||||
if( rc!=SQLITE_OK ){
|
if( rc!=SQLITE_OK ){
|
||||||
OSTRACE(("OPEN name=%s, rc=%s", zUtf8Name, sqlite3ErrName(rc)));
|
OSTRACE(("OPEN name=%s, rc=%s", zUtf8Name, sqlite3ErrName(rc)));
|
||||||
|
|||||||
Reference in New Issue
Block a user