From: drh Date: Mon, 11 Aug 2014 13:53:30 +0000 (+0000) Subject: Changes that will perhaps enable SQLite to work better on VxWorks. X-Git-Tag: version-3.8.6~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=91be7dc32078819a51ef024ba548024d55484179;p=thirdparty%2Fsqlite.git Changes that will perhaps enable SQLite to work better on VxWorks. FossilOrigin-Name: de27c742c0dcda20b51339598bf6094a8dcf5fb9 --- diff --git a/manifest b/manifest index 61a8d036f4..8b2db457d5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\srequirements\smarks.\s\sNo\schanges\sto\scode. -D 2014-08-08T18:26:20.575 +C Changes\sthat\swill\sperhaps\senable\sSQLite\sto\swork\sbetter\son\sVxWorks. +D 2014-08-11T13:53:30.969 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -207,7 +207,7 @@ F src/os.c 1b147e4cf7cc39e618115c14a086aed44bc91ace F src/os.h 60d419395e32a8029fa380a80a3da2e9030f635e F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa -F src/os_unix.c f0a58d439d58b207c06f4a25463113dcba7bd9da +F src/os_unix.c 17e7ab0f9160a78c964d615b15b1658ab2090d42 F src/os_win.c 3fca1bfdf78338705bf536059a407d0fb04016d5 F src/os_win.h 057344a6720b4c8405d9bd98f58cb37a6ee46c25 F src/pager.c f6bb1fa6cdf2062f2d8aec3e64db302bca519ab8 @@ -1185,7 +1185,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P bdaa6947371a60a31b6a13267b0ba6e46df2a8ce -R 72bdb7fa5001d300e89054929fd995d2 +P 7556bd9aa5db1b9cd92d0e48effcda9fe96f3128 +R 07fe7ef4c70cea44dc683244e34b47a2 U drh -Z 671dba8d2ee0bfa11f311df8108f5873 +Z c5b6316215c9354c3470fdb843673338 diff --git a/manifest.uuid b/manifest.uuid index 4ea12bd8df..b1e2fcea2d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7556bd9aa5db1b9cd92d0e48effcda9fe96f3128 \ No newline at end of file +de27c742c0dcda20b51339598bf6094a8dcf5fb9 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 28feb1182c..feb9314167 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -94,11 +94,10 @@ #include #include #if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 -#include +# include #endif - -#if SQLITE_ENABLE_LOCKING_STYLE +#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS # include # if OS_VXWORKS # include @@ -318,7 +317,11 @@ static int posixOpen(const char *zFile, int flags, int mode){ ** we are not running as root. */ static int posixFchown(int fd, uid_t uid, gid_t gid){ +#if OS_VXWORKS + return 0; +#else return geteuid() ? 0 : fchown(fd,uid,gid); +#endif } /* Forward reference */ @@ -374,7 +377,7 @@ static struct unix_syscall { { "read", (sqlite3_syscall_ptr)read, 0 }, #define osRead ((ssize_t(*)(int,void*,size_t))aSyscall[8].pCurrent) -#if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE +#if defined(USE_PREAD) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS) { "pread", (sqlite3_syscall_ptr)pread, 0 }, #else { "pread", (sqlite3_syscall_ptr)0, 0 }, @@ -391,7 +394,7 @@ static struct unix_syscall { { "write", (sqlite3_syscall_ptr)write, 0 }, #define osWrite ((ssize_t(*)(int,const void*,size_t))aSyscall[11].pCurrent) -#if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE +#if defined(USE_PREAD) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS) { "pwrite", (sqlite3_syscall_ptr)pwrite, 0 }, #else { "pwrite", (sqlite3_syscall_ptr)0, 0 }, @@ -1295,7 +1298,11 @@ static int findInodeInfo( static int fileHasMoved(unixFile *pFile){ struct stat buf; return pFile->pInode!=0 && +#if OS_VXWORKS + pFile->pId!=pFile->pInode->fileId.Pid; +#else (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino); +#endif } @@ -2438,7 +2445,6 @@ static int semCheckReservedLock(sqlite3_file *id, int *pResOut) { /* Otherwise see if some other process holds it. */ if( !reserved ){ sem_t *pSem = pFile->pInode->pSem; - struct stat statBuf; if( sem_trywait(pSem)==-1 ){ int tErrno = errno; @@ -2491,7 +2497,6 @@ static int semCheckReservedLock(sqlite3_file *id, int *pResOut) { */ static int semLock(sqlite3_file *id, int eFileLock) { unixFile *pFile = (unixFile*)id; - int fd; sem_t *pSem = pFile->pInode->pSem; int rc = SQLITE_OK;