/ Check-in [8a145863]
Login

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

Overview
Comment:Fix conditional for retry logic in winAccess and add missing call to logIoerr.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8a145863d1a8711953ae72d706404fb96f6fec06
User & Date: mistachkin 2011-07-28 07:34:44
Context
2011-07-28
19:16
Remove redundant sub-expression from retry loop invariant in winAccess. Also, make check for SQLITE_ACCESS_READWRITE formally correct. check-in: 93079a92 user: mistachkin tags: trunk
07:34
Fix conditional for retry logic in winAccess and add missing call to logIoerr. check-in: 8a145863 user: mistachkin tags: trunk
00:14
Use osStat() instead of stat() consistently in os_unix.c check-in: 9109128c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  2451   2451     if( zConverted==0 ){
  2452   2452       return SQLITE_NOMEM;
  2453   2453     }
  2454   2454     if( isNT() ){
  2455   2455       int cnt = 0;
  2456   2456       WIN32_FILE_ATTRIBUTE_DATA sAttrData;
  2457   2457       memset(&sAttrData, 0, sizeof(sAttrData));
  2458         -    while( (rc = GetFileAttributesExW((WCHAR*)zConverted,
         2458  +    while( !(rc = GetFileAttributesExW((WCHAR*)zConverted,
  2459   2459                                GetFileExInfoStandard, 
  2460   2460                                &sAttrData)) && rc==0 && retryIoerr(&cnt) ){}
  2461   2461       if( rc ){
  2462   2462         /* For an SQLITE_ACCESS_EXISTS query, treat a zero-length file
  2463   2463         ** as if it does not exist.
  2464   2464         */
  2465   2465         if(    flags==SQLITE_ACCESS_EXISTS
................................................................................
  2466   2466             && sAttrData.nFileSizeHigh==0 
  2467   2467             && sAttrData.nFileSizeLow==0 ){
  2468   2468           attr = INVALID_FILE_ATTRIBUTES;
  2469   2469         }else{
  2470   2470           attr = sAttrData.dwFileAttributes;
  2471   2471         }
  2472   2472       }else{
         2473  +      logIoerr(cnt);
  2473   2474         if( GetLastError()!=ERROR_FILE_NOT_FOUND ){
  2474   2475           winLogError(SQLITE_IOERR_ACCESS, "winAccess", zFilename);
  2475   2476           free(zConverted);
  2476   2477           return SQLITE_IOERR_ACCESS;
  2477   2478         }else{
  2478   2479           attr = INVALID_FILE_ATTRIBUTES;
  2479   2480         }