1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Make multiple attempts to delete files marked DELETE_ON_CLOSE under

WinCE.  Ticket #2950. (CVS 4802)

FossilOrigin-Name: 5bc8e564e3499ada01a6c3d74b1e6d6906d2a118
This commit is contained in:
drh
2008-02-20 00:00:00 +00:00
parent 7694574abd
commit d641d51171
3 changed files with 16 additions and 8 deletions

View File

@@ -606,9 +606,17 @@ static int winClose(sqlite3_file *id){
rc = CloseHandle(pFile->h);
}while( rc==0 && cnt++ < MX_CLOSE_ATTEMPT && (Sleep(100), 1) );
#if OS_WINCE
#define WINCE_DELETION_ATTEMPTS 3
winceDestroyLock(pFile);
if( pFile->zDeleteOnClose ){
DeleteFileW(pFile->zDeleteOnClose);
int cnt = 0;
while(
DeleteFileW(pFile->zDeleteOnClose)==0
&& GetFileAttributesW(pFile->zDeleteOnClose)!=0xffffffff
&& cnt++ < WINCE_DELETION_ATTEMPTS
){
Sleep(100); /* Wait a little before trying again */
}
free(pFile->zDeleteOnClose);
}
#endif