aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-12-02 13:11:03 +0000
committerdrh <drh@noemail.net>2015-12-02 13:11:03 +0000
commitf3b1ed0fc219d9c3a7caac14694b18bcc6c5c025 (patch)
tree5d008c17b88020d5098dfa0a5c23e06c5c720b11 /src/os_unix.c
parent2c8fd12f42e9f093b935e5225d9e6978825f77b6 (diff)
downloadsqlite-f3b1ed0fc219d9c3a7caac14694b18bcc6c5c025.tar.gz
sqlite-f3b1ed0fc219d9c3a7caac14694b18bcc6c5c025.zip
Minor simplifications to the unix VFS.
FossilOrigin-Name: 2f13c16b45685ec6850cbd9da79e8198bad6a491
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 7038bf12d..00602c6b8 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4123,7 +4123,7 @@ static int unixShmRegionPerMap(void){
static void unixShmPurge(unixFile *pFd){
unixShmNode *p = pFd->pInode->pShmNode;
assert( unixMutexHeld() );
- if( p && p->nRef==0 ){
+ if( p && ALWAYS(p->nRef==0) ){
int nShmPerMap = unixShmRegionPerMap();
int i;
assert( p->pInode==pFd->pInode );
@@ -4210,7 +4210,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
** a new *-shm file is created, an attempt will be made to create it
** with the same permissions.
*/
- if( osFstat(pDbFd->h, &sStat) && pInode->bProcessLock==0 ){
+ if( osFstat(pDbFd->h, &sStat) ){
rc = SQLITE_IOERR_FSTAT;
goto shm_open_err;
}
@@ -4766,17 +4766,13 @@ static void unixRemapfile(
** recreated as a result of outstanding references) or an SQLite error
** code otherwise.
*/
-static int unixMapfile(unixFile *pFd, i64 nByte){
- i64 nMap = nByte;
- int rc;
-
+static int unixMapfile(unixFile *pFd, i64 nMap){
assert( nMap>=0 || pFd->nFetchOut==0 );
if( pFd->nFetchOut>0 ) return SQLITE_OK;
if( nMap<0 ){
struct stat statbuf; /* Low-level file information */
- rc = osFstat(pFd->h, &statbuf);
- if( rc!=SQLITE_OK ){
+ if( osFstat(pFd->h, &statbuf) ){
return SQLITE_IOERR_FSTAT;
}
nMap = statbuf.st_size;