/ Check-in [885c2b44]
Login

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

Overview
Comment:Fix error tests in seldom-used compile-time branches of the unix backend.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 885c2b44a44f8d054014e4079b2cac8279c11d13206d5b5215189ef75b9c5254
User & Date: drh 2017-08-22 15:21:54
Context
2017-08-22
19:54
Modify the SQLITE_SOURCE_ID if the source code has changed in any way since the previous check-in. check-in: 515d6a83 user: drh tags: trunk
19:44
mksourceid still does not work right. Leaf check-in: ca5dcb4a user: drh tags: mistake
19:19
Add the "mksourceid" program to the build process. That program changes the SQLITE_SOURCE_ID if the source tree has been modified in any way. check-in: d4c05e04 user: drh tags: mksourceid
15:21
Fix error tests in seldom-used compile-time branches of the unix backend. check-in: 885c2b44 user: drh tags: trunk
2017-08-21
02:20
Remove an unnecessary conditional. check-in: 56d19f9f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  2317   2317           rc = lrc;
  2318   2318         }
  2319   2319       }
  2320   2320     }
  2321   2321     OSTRACE(("TEST WR-LOCK %d %d %d (flock)\n", pFile->h, rc, reserved));
  2322   2322   
  2323   2323   #ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS
  2324         -  if( (rc & SQLITE_IOERR) == SQLITE_IOERR ){
         2324  +  if( (rc & 0xff) == SQLITE_IOERR ){
  2325   2325       rc = SQLITE_OK;
  2326   2326       reserved=1;
  2327   2327     }
  2328   2328   #endif /* SQLITE_IGNORE_FLOCK_LOCK_ERRORS */
  2329   2329     *pResOut = reserved;
  2330   2330     return rc;
  2331   2331   }
................................................................................
  2384   2384     } else {
  2385   2385       /* got it, set the type and return ok */
  2386   2386       pFile->eFileLock = eFileLock;
  2387   2387     }
  2388   2388     OSTRACE(("LOCK    %d %s %s (flock)\n", pFile->h, azFileLock(eFileLock), 
  2389   2389              rc==SQLITE_OK ? "ok" : "failed"));
  2390   2390   #ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS
  2391         -  if( (rc & SQLITE_IOERR) == SQLITE_IOERR ){
         2391  +  if( (rc & 0xff) == SQLITE_IOERR ){
  2392   2392       rc = SQLITE_BUSY;
  2393   2393     }
  2394   2394   #endif /* SQLITE_IGNORE_FLOCK_LOCK_ERRORS */
  2395   2395     return rc;
  2396   2396   }
  2397   2397   
  2398   2398   
................................................................................
  2921   2921           failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST, 
  2922   2922                                  SHARED_SIZE, 1);
  2923   2923           if( failed && (failed2 = afpSetLock(context->dbPath, pFile, 
  2924   2924                          SHARED_FIRST + pInode->sharedByte, 1, 1)) ){
  2925   2925             /* Can't reestablish the shared lock.  Sqlite can't deal, this is
  2926   2926             ** a critical I/O error
  2927   2927             */
  2928         -          rc = ((failed & SQLITE_IOERR) == SQLITE_IOERR) ? failed2 : 
         2928  +          rc = ((failed & 0xff) == SQLITE_IOERR) ? failed2 : 
  2929   2929                  SQLITE_IOERR_LOCK;
  2930   2930             goto afp_end_lock;
  2931   2931           } 
  2932   2932         }else{
  2933   2933           rc = failed; 
  2934   2934         }
  2935   2935       }