Fossil SCM
Another attempt, taking VxWorks patch on trunk into account.
Commit
c2d4bd73657709eb5e9acbe453a7bcc4fc65a6ff
Parent
981e853f6c95923…
2 files changed
+12
-7
+12
-7
+12
-7
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -25565,15 +25565,16 @@ | ||
| 25565 | 25565 | |
| 25566 | 25566 | /* |
| 25567 | 25567 | ** Return TRUE if pFile has been renamed or unlinked since it was first opened. |
| 25568 | 25568 | */ |
| 25569 | 25569 | static int fileHasMoved(unixFile *pFile){ |
| 25570 | +#if OS_VXWORKS | |
| 25571 | + return pFile->pInode!=0 && | |
| 25572 | + pFile->pId!=pFile->pInode->fileId.pId; | |
| 25573 | +#else | |
| 25570 | 25574 | struct stat buf; |
| 25571 | 25575 | return pFile->pInode!=0 && |
| 25572 | -#if OS_VXWORKS | |
| 25573 | - pFile->pId!=pFile->pInode->fileId.Pid; | |
| 25574 | -#else | |
| 25575 | 25576 | (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino); |
| 25576 | 25577 | #endif |
| 25577 | 25578 | } |
| 25578 | 25579 | |
| 25579 | 25580 | |
| @@ -29896,14 +29897,14 @@ | ||
| 29896 | 29897 | int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE); |
| 29897 | 29898 | int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE); |
| 29898 | 29899 | int isCreate = (flags & SQLITE_OPEN_CREATE); |
| 29899 | 29900 | int isReadonly = (flags & SQLITE_OPEN_READONLY); |
| 29900 | 29901 | int isReadWrite = (flags & SQLITE_OPEN_READWRITE); |
| 29901 | -#if SQLITE_ENABLE_LOCKING_STYLE | |
| 29902 | +#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) | |
| 29902 | 29903 | int isAutoProxy = (flags & SQLITE_OPEN_AUTOPROXY); |
| 29903 | 29904 | #endif |
| 29904 | -#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE | |
| 29905 | +#if defined(__APPLE__) | |
| 29905 | 29906 | struct statfs fsInfo; |
| 29906 | 29907 | #endif |
| 29907 | 29908 | |
| 29908 | 29909 | /* If creating a master or main-file journal, this function will open |
| 29909 | 29910 | ** a file-descriptor on the directory too. The first time unixSync() |
| @@ -30065,11 +30066,11 @@ | ||
| 30065 | 30066 | #endif |
| 30066 | 30067 | |
| 30067 | 30068 | noLock = eType!=SQLITE_OPEN_MAIN_DB; |
| 30068 | 30069 | |
| 30069 | 30070 | |
| 30070 | -#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE | |
| 30071 | +#if defined(__APPLE__) | |
| 30071 | 30072 | if( fstatfs(fd, &fsInfo) == -1 ){ |
| 30072 | 30073 | ((unixFile*)pFile)->lastErrno = errno; |
| 30073 | 30074 | robust_close(p, fd, __LINE__); |
| 30074 | 30075 | return SQLITE_IOERR_ACCESS; |
| 30075 | 30076 | } |
| @@ -30083,11 +30084,11 @@ | ||
| 30083 | 30084 | if( isReadonly ) ctrlFlags |= UNIXFILE_RDONLY; |
| 30084 | 30085 | if( noLock ) ctrlFlags |= UNIXFILE_NOLOCK; |
| 30085 | 30086 | if( syncDir ) ctrlFlags |= UNIXFILE_DIRSYNC; |
| 30086 | 30087 | if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI; |
| 30087 | 30088 | |
| 30088 | -#if SQLITE_ENABLE_LOCKING_STYLE | |
| 30089 | +#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) | |
| 30089 | 30090 | #if SQLITE_PREFER_PROXY_LOCKING |
| 30090 | 30091 | isAutoProxy = 1; |
| 30091 | 30092 | #endif |
| 30092 | 30093 | if( isAutoProxy && (zPath!=NULL) && (!noLock) && pVfs->xOpen ){ |
| 30093 | 30094 | char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); |
| @@ -30154,10 +30155,14 @@ | ||
| 30154 | 30155 | UNUSED_PARAMETER(NotUsed); |
| 30155 | 30156 | SimulateIOError(return SQLITE_IOERR_DELETE); |
| 30156 | 30157 | if( osUnlink(zPath)==(-1) ){ |
| 30157 | 30158 | if( errno==ENOENT ){ |
| 30158 | 30159 | rc = SQLITE_IOERR_DELETE_NOENT; |
| 30160 | +#if OS_VXWORKS | |
| 30161 | + }else if( errno==0x380003 ){ /* == S_dosFsLib_FILE_NOT_FOUND */ | |
| 30162 | + rc = SQLITE_IOERR_DELETE_NOENT; | |
| 30163 | +#endif | |
| 30159 | 30164 | }else{ |
| 30160 | 30165 | rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath); |
| 30161 | 30166 | } |
| 30162 | 30167 | return rc; |
| 30163 | 30168 | } |
| 30164 | 30169 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -25565,15 +25565,16 @@ | |
| 25565 | |
| 25566 | /* |
| 25567 | ** Return TRUE if pFile has been renamed or unlinked since it was first opened. |
| 25568 | */ |
| 25569 | static int fileHasMoved(unixFile *pFile){ |
| 25570 | struct stat buf; |
| 25571 | return pFile->pInode!=0 && |
| 25572 | #if OS_VXWORKS |
| 25573 | pFile->pId!=pFile->pInode->fileId.Pid; |
| 25574 | #else |
| 25575 | (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino); |
| 25576 | #endif |
| 25577 | } |
| 25578 | |
| 25579 | |
| @@ -29896,14 +29897,14 @@ | |
| 29896 | int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE); |
| 29897 | int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE); |
| 29898 | int isCreate = (flags & SQLITE_OPEN_CREATE); |
| 29899 | int isReadonly = (flags & SQLITE_OPEN_READONLY); |
| 29900 | int isReadWrite = (flags & SQLITE_OPEN_READWRITE); |
| 29901 | #if SQLITE_ENABLE_LOCKING_STYLE |
| 29902 | int isAutoProxy = (flags & SQLITE_OPEN_AUTOPROXY); |
| 29903 | #endif |
| 29904 | #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE |
| 29905 | struct statfs fsInfo; |
| 29906 | #endif |
| 29907 | |
| 29908 | /* If creating a master or main-file journal, this function will open |
| 29909 | ** a file-descriptor on the directory too. The first time unixSync() |
| @@ -30065,11 +30066,11 @@ | |
| 30065 | #endif |
| 30066 | |
| 30067 | noLock = eType!=SQLITE_OPEN_MAIN_DB; |
| 30068 | |
| 30069 | |
| 30070 | #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE |
| 30071 | if( fstatfs(fd, &fsInfo) == -1 ){ |
| 30072 | ((unixFile*)pFile)->lastErrno = errno; |
| 30073 | robust_close(p, fd, __LINE__); |
| 30074 | return SQLITE_IOERR_ACCESS; |
| 30075 | } |
| @@ -30083,11 +30084,11 @@ | |
| 30083 | if( isReadonly ) ctrlFlags |= UNIXFILE_RDONLY; |
| 30084 | if( noLock ) ctrlFlags |= UNIXFILE_NOLOCK; |
| 30085 | if( syncDir ) ctrlFlags |= UNIXFILE_DIRSYNC; |
| 30086 | if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI; |
| 30087 | |
| 30088 | #if SQLITE_ENABLE_LOCKING_STYLE |
| 30089 | #if SQLITE_PREFER_PROXY_LOCKING |
| 30090 | isAutoProxy = 1; |
| 30091 | #endif |
| 30092 | if( isAutoProxy && (zPath!=NULL) && (!noLock) && pVfs->xOpen ){ |
| 30093 | char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); |
| @@ -30154,10 +30155,14 @@ | |
| 30154 | UNUSED_PARAMETER(NotUsed); |
| 30155 | SimulateIOError(return SQLITE_IOERR_DELETE); |
| 30156 | if( osUnlink(zPath)==(-1) ){ |
| 30157 | if( errno==ENOENT ){ |
| 30158 | rc = SQLITE_IOERR_DELETE_NOENT; |
| 30159 | }else{ |
| 30160 | rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath); |
| 30161 | } |
| 30162 | return rc; |
| 30163 | } |
| 30164 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -25565,15 +25565,16 @@ | |
| 25565 | |
| 25566 | /* |
| 25567 | ** Return TRUE if pFile has been renamed or unlinked since it was first opened. |
| 25568 | */ |
| 25569 | static int fileHasMoved(unixFile *pFile){ |
| 25570 | #if OS_VXWORKS |
| 25571 | return pFile->pInode!=0 && |
| 25572 | pFile->pId!=pFile->pInode->fileId.pId; |
| 25573 | #else |
| 25574 | struct stat buf; |
| 25575 | return pFile->pInode!=0 && |
| 25576 | (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino); |
| 25577 | #endif |
| 25578 | } |
| 25579 | |
| 25580 | |
| @@ -29896,14 +29897,14 @@ | |
| 29897 | int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE); |
| 29898 | int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE); |
| 29899 | int isCreate = (flags & SQLITE_OPEN_CREATE); |
| 29900 | int isReadonly = (flags & SQLITE_OPEN_READONLY); |
| 29901 | int isReadWrite = (flags & SQLITE_OPEN_READWRITE); |
| 29902 | #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) |
| 29903 | int isAutoProxy = (flags & SQLITE_OPEN_AUTOPROXY); |
| 29904 | #endif |
| 29905 | #if defined(__APPLE__) |
| 29906 | struct statfs fsInfo; |
| 29907 | #endif |
| 29908 | |
| 29909 | /* If creating a master or main-file journal, this function will open |
| 29910 | ** a file-descriptor on the directory too. The first time unixSync() |
| @@ -30065,11 +30066,11 @@ | |
| 30066 | #endif |
| 30067 | |
| 30068 | noLock = eType!=SQLITE_OPEN_MAIN_DB; |
| 30069 | |
| 30070 | |
| 30071 | #if defined(__APPLE__) |
| 30072 | if( fstatfs(fd, &fsInfo) == -1 ){ |
| 30073 | ((unixFile*)pFile)->lastErrno = errno; |
| 30074 | robust_close(p, fd, __LINE__); |
| 30075 | return SQLITE_IOERR_ACCESS; |
| 30076 | } |
| @@ -30083,11 +30084,11 @@ | |
| 30084 | if( isReadonly ) ctrlFlags |= UNIXFILE_RDONLY; |
| 30085 | if( noLock ) ctrlFlags |= UNIXFILE_NOLOCK; |
| 30086 | if( syncDir ) ctrlFlags |= UNIXFILE_DIRSYNC; |
| 30087 | if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI; |
| 30088 | |
| 30089 | #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) |
| 30090 | #if SQLITE_PREFER_PROXY_LOCKING |
| 30091 | isAutoProxy = 1; |
| 30092 | #endif |
| 30093 | if( isAutoProxy && (zPath!=NULL) && (!noLock) && pVfs->xOpen ){ |
| 30094 | char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); |
| @@ -30154,10 +30155,14 @@ | |
| 30155 | UNUSED_PARAMETER(NotUsed); |
| 30156 | SimulateIOError(return SQLITE_IOERR_DELETE); |
| 30157 | if( osUnlink(zPath)==(-1) ){ |
| 30158 | if( errno==ENOENT ){ |
| 30159 | rc = SQLITE_IOERR_DELETE_NOENT; |
| 30160 | #if OS_VXWORKS |
| 30161 | }else if( errno==0x380003 ){ /* == S_dosFsLib_FILE_NOT_FOUND */ |
| 30162 | rc = SQLITE_IOERR_DELETE_NOENT; |
| 30163 | #endif |
| 30164 | }else{ |
| 30165 | rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath); |
| 30166 | } |
| 30167 | return rc; |
| 30168 | } |
| 30169 |
+12
-7
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -25565,15 +25565,16 @@ | ||
| 25565 | 25565 | |
| 25566 | 25566 | /* |
| 25567 | 25567 | ** Return TRUE if pFile has been renamed or unlinked since it was first opened. |
| 25568 | 25568 | */ |
| 25569 | 25569 | static int fileHasMoved(unixFile *pFile){ |
| 25570 | +#if OS_VXWORKS | |
| 25571 | + return pFile->pInode!=0 && | |
| 25572 | + pFile->pId!=pFile->pInode->fileId.pId; | |
| 25573 | +#else | |
| 25570 | 25574 | struct stat buf; |
| 25571 | 25575 | return pFile->pInode!=0 && |
| 25572 | -#if OS_VXWORKS | |
| 25573 | - pFile->pId!=pFile->pInode->fileId.Pid; | |
| 25574 | -#else | |
| 25575 | 25576 | (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino); |
| 25576 | 25577 | #endif |
| 25577 | 25578 | } |
| 25578 | 25579 | |
| 25579 | 25580 | |
| @@ -29896,14 +29897,14 @@ | ||
| 29896 | 29897 | int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE); |
| 29897 | 29898 | int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE); |
| 29898 | 29899 | int isCreate = (flags & SQLITE_OPEN_CREATE); |
| 29899 | 29900 | int isReadonly = (flags & SQLITE_OPEN_READONLY); |
| 29900 | 29901 | int isReadWrite = (flags & SQLITE_OPEN_READWRITE); |
| 29901 | -#if SQLITE_ENABLE_LOCKING_STYLE | |
| 29902 | +#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) | |
| 29902 | 29903 | int isAutoProxy = (flags & SQLITE_OPEN_AUTOPROXY); |
| 29903 | 29904 | #endif |
| 29904 | -#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE | |
| 29905 | +#if defined(__APPLE__) | |
| 29905 | 29906 | struct statfs fsInfo; |
| 29906 | 29907 | #endif |
| 29907 | 29908 | |
| 29908 | 29909 | /* If creating a master or main-file journal, this function will open |
| 29909 | 29910 | ** a file-descriptor on the directory too. The first time unixSync() |
| @@ -30065,11 +30066,11 @@ | ||
| 30065 | 30066 | #endif |
| 30066 | 30067 | |
| 30067 | 30068 | noLock = eType!=SQLITE_OPEN_MAIN_DB; |
| 30068 | 30069 | |
| 30069 | 30070 | |
| 30070 | -#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE | |
| 30071 | +#if defined(__APPLE__) | |
| 30071 | 30072 | if( fstatfs(fd, &fsInfo) == -1 ){ |
| 30072 | 30073 | ((unixFile*)pFile)->lastErrno = errno; |
| 30073 | 30074 | robust_close(p, fd, __LINE__); |
| 30074 | 30075 | return SQLITE_IOERR_ACCESS; |
| 30075 | 30076 | } |
| @@ -30083,11 +30084,11 @@ | ||
| 30083 | 30084 | if( isReadonly ) ctrlFlags |= UNIXFILE_RDONLY; |
| 30084 | 30085 | if( noLock ) ctrlFlags |= UNIXFILE_NOLOCK; |
| 30085 | 30086 | if( syncDir ) ctrlFlags |= UNIXFILE_DIRSYNC; |
| 30086 | 30087 | if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI; |
| 30087 | 30088 | |
| 30088 | -#if SQLITE_ENABLE_LOCKING_STYLE | |
| 30089 | +#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) | |
| 30089 | 30090 | #if SQLITE_PREFER_PROXY_LOCKING |
| 30090 | 30091 | isAutoProxy = 1; |
| 30091 | 30092 | #endif |
| 30092 | 30093 | if( isAutoProxy && (zPath!=NULL) && (!noLock) && pVfs->xOpen ){ |
| 30093 | 30094 | char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); |
| @@ -30154,10 +30155,14 @@ | ||
| 30154 | 30155 | UNUSED_PARAMETER(NotUsed); |
| 30155 | 30156 | SimulateIOError(return SQLITE_IOERR_DELETE); |
| 30156 | 30157 | if( osUnlink(zPath)==(-1) ){ |
| 30157 | 30158 | if( errno==ENOENT ){ |
| 30158 | 30159 | rc = SQLITE_IOERR_DELETE_NOENT; |
| 30160 | +#if OS_VXWORKS | |
| 30161 | + }else if( errno==0x380003 ){ /* == S_dosFsLib_FILE_NOT_FOUND */ | |
| 30162 | + rc = SQLITE_IOERR_DELETE_NOENT; | |
| 30163 | +#endif | |
| 30159 | 30164 | }else{ |
| 30160 | 30165 | rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath); |
| 30161 | 30166 | } |
| 30162 | 30167 | return rc; |
| 30163 | 30168 | } |
| 30164 | 30169 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -25565,15 +25565,16 @@ | |
| 25565 | |
| 25566 | /* |
| 25567 | ** Return TRUE if pFile has been renamed or unlinked since it was first opened. |
| 25568 | */ |
| 25569 | static int fileHasMoved(unixFile *pFile){ |
| 25570 | struct stat buf; |
| 25571 | return pFile->pInode!=0 && |
| 25572 | #if OS_VXWORKS |
| 25573 | pFile->pId!=pFile->pInode->fileId.Pid; |
| 25574 | #else |
| 25575 | (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino); |
| 25576 | #endif |
| 25577 | } |
| 25578 | |
| 25579 | |
| @@ -29896,14 +29897,14 @@ | |
| 29896 | int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE); |
| 29897 | int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE); |
| 29898 | int isCreate = (flags & SQLITE_OPEN_CREATE); |
| 29899 | int isReadonly = (flags & SQLITE_OPEN_READONLY); |
| 29900 | int isReadWrite = (flags & SQLITE_OPEN_READWRITE); |
| 29901 | #if SQLITE_ENABLE_LOCKING_STYLE |
| 29902 | int isAutoProxy = (flags & SQLITE_OPEN_AUTOPROXY); |
| 29903 | #endif |
| 29904 | #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE |
| 29905 | struct statfs fsInfo; |
| 29906 | #endif |
| 29907 | |
| 29908 | /* If creating a master or main-file journal, this function will open |
| 29909 | ** a file-descriptor on the directory too. The first time unixSync() |
| @@ -30065,11 +30066,11 @@ | |
| 30065 | #endif |
| 30066 | |
| 30067 | noLock = eType!=SQLITE_OPEN_MAIN_DB; |
| 30068 | |
| 30069 | |
| 30070 | #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE |
| 30071 | if( fstatfs(fd, &fsInfo) == -1 ){ |
| 30072 | ((unixFile*)pFile)->lastErrno = errno; |
| 30073 | robust_close(p, fd, __LINE__); |
| 30074 | return SQLITE_IOERR_ACCESS; |
| 30075 | } |
| @@ -30083,11 +30084,11 @@ | |
| 30083 | if( isReadonly ) ctrlFlags |= UNIXFILE_RDONLY; |
| 30084 | if( noLock ) ctrlFlags |= UNIXFILE_NOLOCK; |
| 30085 | if( syncDir ) ctrlFlags |= UNIXFILE_DIRSYNC; |
| 30086 | if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI; |
| 30087 | |
| 30088 | #if SQLITE_ENABLE_LOCKING_STYLE |
| 30089 | #if SQLITE_PREFER_PROXY_LOCKING |
| 30090 | isAutoProxy = 1; |
| 30091 | #endif |
| 30092 | if( isAutoProxy && (zPath!=NULL) && (!noLock) && pVfs->xOpen ){ |
| 30093 | char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); |
| @@ -30154,10 +30155,14 @@ | |
| 30154 | UNUSED_PARAMETER(NotUsed); |
| 30155 | SimulateIOError(return SQLITE_IOERR_DELETE); |
| 30156 | if( osUnlink(zPath)==(-1) ){ |
| 30157 | if( errno==ENOENT ){ |
| 30158 | rc = SQLITE_IOERR_DELETE_NOENT; |
| 30159 | }else{ |
| 30160 | rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath); |
| 30161 | } |
| 30162 | return rc; |
| 30163 | } |
| 30164 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -25565,15 +25565,16 @@ | |
| 25565 | |
| 25566 | /* |
| 25567 | ** Return TRUE if pFile has been renamed or unlinked since it was first opened. |
| 25568 | */ |
| 25569 | static int fileHasMoved(unixFile *pFile){ |
| 25570 | #if OS_VXWORKS |
| 25571 | return pFile->pInode!=0 && |
| 25572 | pFile->pId!=pFile->pInode->fileId.pId; |
| 25573 | #else |
| 25574 | struct stat buf; |
| 25575 | return pFile->pInode!=0 && |
| 25576 | (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino); |
| 25577 | #endif |
| 25578 | } |
| 25579 | |
| 25580 | |
| @@ -29896,14 +29897,14 @@ | |
| 29897 | int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE); |
| 29898 | int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE); |
| 29899 | int isCreate = (flags & SQLITE_OPEN_CREATE); |
| 29900 | int isReadonly = (flags & SQLITE_OPEN_READONLY); |
| 29901 | int isReadWrite = (flags & SQLITE_OPEN_READWRITE); |
| 29902 | #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) |
| 29903 | int isAutoProxy = (flags & SQLITE_OPEN_AUTOPROXY); |
| 29904 | #endif |
| 29905 | #if defined(__APPLE__) |
| 29906 | struct statfs fsInfo; |
| 29907 | #endif |
| 29908 | |
| 29909 | /* If creating a master or main-file journal, this function will open |
| 29910 | ** a file-descriptor on the directory too. The first time unixSync() |
| @@ -30065,11 +30066,11 @@ | |
| 30066 | #endif |
| 30067 | |
| 30068 | noLock = eType!=SQLITE_OPEN_MAIN_DB; |
| 30069 | |
| 30070 | |
| 30071 | #if defined(__APPLE__) |
| 30072 | if( fstatfs(fd, &fsInfo) == -1 ){ |
| 30073 | ((unixFile*)pFile)->lastErrno = errno; |
| 30074 | robust_close(p, fd, __LINE__); |
| 30075 | return SQLITE_IOERR_ACCESS; |
| 30076 | } |
| @@ -30083,11 +30084,11 @@ | |
| 30084 | if( isReadonly ) ctrlFlags |= UNIXFILE_RDONLY; |
| 30085 | if( noLock ) ctrlFlags |= UNIXFILE_NOLOCK; |
| 30086 | if( syncDir ) ctrlFlags |= UNIXFILE_DIRSYNC; |
| 30087 | if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI; |
| 30088 | |
| 30089 | #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) |
| 30090 | #if SQLITE_PREFER_PROXY_LOCKING |
| 30091 | isAutoProxy = 1; |
| 30092 | #endif |
| 30093 | if( isAutoProxy && (zPath!=NULL) && (!noLock) && pVfs->xOpen ){ |
| 30094 | char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); |
| @@ -30154,10 +30155,14 @@ | |
| 30155 | UNUSED_PARAMETER(NotUsed); |
| 30156 | SimulateIOError(return SQLITE_IOERR_DELETE); |
| 30157 | if( osUnlink(zPath)==(-1) ){ |
| 30158 | if( errno==ENOENT ){ |
| 30159 | rc = SQLITE_IOERR_DELETE_NOENT; |
| 30160 | #if OS_VXWORKS |
| 30161 | }else if( errno==0x380003 ){ /* == S_dosFsLib_FILE_NOT_FOUND */ |
| 30162 | rc = SQLITE_IOERR_DELETE_NOENT; |
| 30163 | #endif |
| 30164 | }else{ |
| 30165 | rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath); |
| 30166 | } |
| 30167 | return rc; |
| 30168 | } |
| 30169 |