/ Check-in [5bc8e564]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make multiple attempts to delete files marked DELETE_ON_CLOSE under WinCE. Ticket #2950. (CVS 4802)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:5bc8e564e3499ada01a6c3d74b1e6d6906d2a118
User & Date: drh 2008-02-20 00:00:00
Context
2008-02-21
02:09
Test coverage and documentation improvements. (CVS 4803) check-in: e0baceac user: drh tags: trunk
2008-02-20
00:00
Make multiple attempts to delete files marked DELETE_ON_CLOSE under WinCE. Ticket #2950. (CVS 4802) check-in: 5bc8e564 user: drh tags: trunk
2008-02-19
18:29
Remove instances of strcpy() from test code. Use memcpy() or sqlite3_snprintf() instead. (CVS 4801) check-in: 7b50140d user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

602
603
604
605
606
607
608

609
610


611





612
613
614
615
616
617
618
  int rc, cnt = 0;
  winFile *pFile = (winFile*)id;
  OSTRACE2("CLOSE %d\n", pFile->h);
  do{
    rc = CloseHandle(pFile->h);
  }while( rc==0 && cnt++ < MX_CLOSE_ATTEMPT && (Sleep(100), 1) );
#if OS_WINCE

  winceDestroyLock(pFile);
  if( pFile->zDeleteOnClose ){


    DeleteFileW(pFile->zDeleteOnClose);





    free(pFile->zDeleteOnClose);
  }
#endif
  OpenCounter(-1);
  return rc ? SQLITE_OK : SQLITE_IOERR;
}








>


>
>
|
>
>
>
>
>







602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
  int rc, cnt = 0;
  winFile *pFile = (winFile*)id;
  OSTRACE2("CLOSE %d\n", pFile->h);
  do{
    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 ){
    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
  OpenCounter(-1);
  return rc ? SQLITE_OK : SQLITE_IOERR;
}