/ Check-in [96e7d638]
Login

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

Overview
Comment:Small simplification to the xOpen method in the unix VFS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 96e7d638ecdabbf84a152036eb01d408d142839e
User & Date: drh 2015-11-26 02:21:05
Context
2015-11-26
10:37
Simplify logic for syncing directories after creating or deleting a file in the unix VFS. check-in: eb180b4f user: drh tags: trunk
02:21
Small simplification to the xOpen method in the unix VFS. check-in: 96e7d638 user: drh tags: trunk
2015-11-25
23:13
Simplify the temporary filename generator and the time-of-day functions in the unix VFS. check-in: 6c5621ce user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  5742   5742       if( rc!=SQLITE_OK ){
  5743   5743         assert( !p->pUnused );
  5744   5744         assert( eType==SQLITE_OPEN_WAL || eType==SQLITE_OPEN_MAIN_JOURNAL );
  5745   5745         return rc;
  5746   5746       }
  5747   5747       fd = robust_open(zName, openFlags, openMode);
  5748   5748       OSTRACE(("OPENX   %-3d %s 0%o\n", fd, zName, openFlags));
  5749         -    if( fd<0 && errno!=EISDIR && isReadWrite && !isExclusive ){
         5749  +    assert( !isExclusive || (openFlags & O_CREAT)!=0 );
         5750  +    if( fd<0 && errno!=EISDIR && isReadWrite ){
  5750   5751         /* Failed to open the file for read/write access. Try read-only. */
  5751   5752         flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);
  5752   5753         openFlags &= ~(O_RDWR|O_CREAT);
  5753   5754         flags |= SQLITE_OPEN_READONLY;
  5754   5755         openFlags |= O_RDONLY;
  5755   5756         isReadonly = 1;
  5756   5757         fd = robust_open(zName, openFlags, openMode);