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

Performance improvement and bug fix in sqlite3WinDelete(). (CVS 3445)

FossilOrigin-Name: 46ac1ac2d10cf2f1ebfb8dd4bb9a2ccffd85e816
This commit is contained in:
drh
2006-09-26 00:34:17 +00:00
parent 7f986a651e
commit 50c2b35ea7
3 changed files with 12 additions and 10 deletions

View File

@@ -495,7 +495,8 @@ int sqlite3WinDelete(const char *zFilename){
if( zWide ){
do{
rc = DeleteFileW(zWide);
}while( rc==0 && cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
}while( rc==0 && GetFileAttributesW(zWide)!=0xffffffff
&& cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
sqliteFree(zWide);
}else{
#if OS_WINCE
@@ -503,11 +504,12 @@ int sqlite3WinDelete(const char *zFilename){
#else
do{
rc = DeleteFileA(zFilename);
}while( rc==0 && cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
}while( rc==0 && GetFileAttributesA(zFilename)
&& cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
#endif
}
TRACE2("DELETE \"%s\"\n", zFilename);
return rc==0 ? SQLITE_OK : SQLITE_IOERR;
return rc!=0 ? SQLITE_OK : SQLITE_IOERR;
}
/*