]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Enable the LOCKING_STYLE extensions by default on a Mac. Leave them
authordrh <drh@noemail.net>
Tue, 23 Sep 2008 10:23:26 +0000 (10:23 +0000)
committerdrh <drh@noemail.net>
Tue, 23 Sep 2008 10:23:26 +0000 (10:23 +0000)
disabled on all other posix platforms. (CVS 5737)

FossilOrigin-Name: bae1d5b16948705b7dec7b139e3586b4b510cbfa

manifest
manifest.uuid
src/os_unix.c

index 0368390614430db600fe17ec338336764d423d9c..c1d09bf535a758fe67979a9eb541a124df041edb 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Remove\san\sunused\svariable\sfrom\sthe\stest\slogic.\s(CVS\s5736)
-D 2008-09-23T10:16:05
+C Enable\sthe\sLOCKING_STYLE\sextensions\sby\sdefault\son\sa\sMac.\s\sLeave\sthem\ndisabled\son\sall\sother\sposix\splatforms.\s(CVS\s5737)
+D 2008-09-23T10:23:26
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in e4ab842f9a64ef61d57093539a8aab76b12810db
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -135,7 +135,7 @@ F src/os.c 543976efc0b177b40779d5fc00f709d6888d6903
 F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892
 F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60
 F src/os_os2.c e391fc95adc744bbdcefd4d11e3066998185a0a0
-F src/os_unix.c badd226d71460f0be57f68843ef66a258b0a376c
+F src/os_unix.c ee778087d7b73746598947a93d2e1de3f909c9c2
 F src/os_win.c 3209dc0ed734291764393ea8d534ba0d8696a540
 F src/pager.c 131746ea47383daf89fce08e0cb09b84cffa39eb
 F src/pager.h 1ef5a3f8e0b4c8b30f19c8e01d4fca2db9bb5797
@@ -637,7 +637,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P a88606245760eaf8054d67773db7d8b795e8ca25
-R 5f4ced03c359d22319ca21d407dd7159
+P 309ba380d985d77419a6e185373493e043823258
+R 2c9572d754434b5bfdf3e25c7b3dbb14
 U drh
-Z a47e0f847ded8ccc3b472866b58d53b2
+Z 1990ad5dc1d65a186d212ae883760b71
index dd52f5cd3c0f0204983d8a465681131042887842..3fc56fe4c6b4e2571e5cfdca8848dea44eabeec3 100644 (file)
@@ -1 +1 @@
-309ba380d985d77419a6e185373493e043823258
\ No newline at end of file
+bae1d5b16948705b7dec7b139e3586b4b510cbfa
\ No newline at end of file
index ea38ec5cf92362c5e18475a0b756f7827f0131f0..d9272eef97352f6f75584dfe7466badd5ddc358c 100644 (file)
 **
 ** This file contains code that is specific to Unix systems.
 **
-** $Id: os_unix.c,v 1.202 2008/09/22 11:46:33 danielk1977 Exp $
+** $Id: os_unix.c,v 1.203 2008/09/23 10:23:26 drh Exp $
 */
 #include "sqliteInt.h"
 #if SQLITE_OS_UNIX              /* This file is used on unix only */
 
 /*
-** If SQLITE_ENABLE_LOCKING_STYLE is defined, then several different 
-** locking implementations are provided:
+** If SQLITE_ENABLE_LOCKING_STYLE is defined and is non-zero, then several
+** alternative locking implementations are provided:
 **
 **   * POSIX locking (the default),
 **   * No locking,
 **   * Dot-file locking,
 **   * flock() locking,
 **   * AFP locking (OSX only).
-*/
-/* #define SQLITE_ENABLE_LOCKING_STYLE 0 */
+**
+** SQLITE_ENABLE_LOCKING_STYLE only works on a Mac. It is turned on by
+** default on a Mac and disabled on all other posix platforms.
+*/
+#if !defined(SQLITE_ENABLE_LOCKING_STYLE)
+#  if defined(__DARWIN__)
+#    define SQLITE_ENABLE_LOCKING_STYLE 1
+#  else
+#    define SQLITE_ENABLE_LOCKING_STYLE 0
+#  endif
+#endif
 
 /*
 ** These #defines should enable >2GB file support on Posix if the
@@ -61,7 +70,7 @@
 #include <sys/time.h>
 #include <errno.h>
 
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
 #include <sys/ioctl.h>
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -104,7 +113,7 @@ struct unixFile {
 #endif
   struct openCnt *pOpen;    /* Info about all open fd's on this inode */
   struct lockInfo *pLock;   /* Info about locks on this inode */
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
   void *lockingContext;     /* Locking style specific state */
 #endif
   int h;                    /* The file descriptor */
@@ -573,7 +582,7 @@ static void releaseOpenCnt(struct openCnt *pOpen){
   }
 }
 
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
 /*
 ** Tests a byte-range locking query to see if byte range locks are 
 ** supported, if not we fall back to dotlockLockingStyle.
@@ -615,7 +624,7 @@ static int detectLockingStyle(
   const char *filePath, 
   int fd
 ){
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
   struct Mapping {
     const char *zFilesystem;
     int eLockingStyle;
@@ -1662,7 +1671,7 @@ static int unixClose(sqlite3_file *id){
 }
 
 
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
 #pragma mark AFP Support
 
 /*
@@ -2352,7 +2361,7 @@ static int fillInUnixFile(
   static sqlite3_io_methods aIoMethod[] = {
     IOMETHODS(unixClose, unixLock, unixUnlock, unixCheckReservedLock) 
    ,IOMETHODS(nolockClose, nolockLock, nolockUnlock, nolockCheckReservedLock)
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
    ,IOMETHODS(dotlockClose, dotlockLock, dotlockUnlock,dotlockCheckReservedLock)
    ,IOMETHODS(flockClose, flockLock, flockUnlock, flockCheckReservedLock)
    ,IOMETHODS(afpClose, afpLock, afpUnlock, afpCheckReservedLock)
@@ -2390,7 +2399,7 @@ static int fillInUnixFile(
       break;
     }
 
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
     case LOCKING_STYLE_AFP: {
       /* AFP locking uses the file path so it needs to be included in
       ** the afpLockingContext.
@@ -2951,7 +2960,7 @@ int sqlite3_os_init(void){
   }
 
   static sqlite3_vfs unixVfs = UNIXVFS("unix", 0);
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
   int i;
   static sqlite3_vfs aVfs[] = {
     UNIXVFS("unix-posix",   LOCKING_STYLE_POSIX),