Index: src/os_unix.c ================================================================== --- src/os_unix.c +++ src/os_unix.c @@ -41,11 +41,11 @@ ** * sqlite3_vfs method implementations. ** * Locking primitives for the proxy uber-locking-method. (MacOSX only) ** * Definitions of sqlite3_vfs objects for all locking methods ** plus implementations of sqlite3_os_init() and sqlite3_os_end(). ** -** $Id: os_unix.c,v 1.228 2008/12/03 22:48:33 drh Exp $ +** $Id: os_unix.c,v 1.229 2008/12/04 12:34:16 drh Exp $ */ #include "sqliteInt.h" #if SQLITE_OS_UNIX /* This file is used on unix only */ /* @@ -2937,15 +2937,17 @@ return SQLITE_OK; } +#if SQLITE_ENABLE_LOCKING_MODE && defined(__DARWIN__) /* ** Handler for proxy-locking file-control verbs. Defined below in the ** proxying locking division. */ static int proxyFileControl(sqlite3_file*,int,void*); +#endif /* ** Information and control of an open file handle. */ @@ -3283,11 +3285,10 @@ unixLeaveMutex(); } } #endif -#if SQLITE_ENABLE_LOCKING_STYLE else if( pLockingStyle == &dotlockIoMethods ){ /* Dotfile locking uses the file path so it needs to be included in ** the dotlockLockingContext */ char *zLockFile; @@ -3299,11 +3300,10 @@ }else{ sqlite3_snprintf(nFilename, zLockFile, "%s" DOTLOCK_SUFFIX, zFilename); } pNew->lockingContext = zLockFile; } -#endif #if OS_VXWORKS else if( pLockingStyle == &semIoMethods ){ /* Named semaphore locking uses the file path so it needs to be ** included in the semLockingContext @@ -3435,16 +3435,18 @@ zBuf[j] = 0; }while( access(zBuf,0)==0 ); return SQLITE_OK; } +#if SQLITE_ENABLE_LOCKING_MODE && defined(__DARWIN__) /* ** Routine to transform a unixFile into a proxy-locking unixFile. ** Implementation in the proxy-lock division, but used by unixOpen() ** if SQLITE_PREFER_PROXY_LOCKING is defined. */ static int proxyTransformUnixFile(unixFile*, const char*); +#endif /* ** Open the file zPath. ** Index: test/lock5.test ================================================================== --- test/lock5.test +++ test/lock5.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is database locks. # -# $Id: lock5.test,v 1.5 2008/11/29 02:20:27 drh Exp $ +# $Id: lock5.test,v 1.6 2008/12/04 12:34:16 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # This file is only run if using the unix backend compiled with the @@ -99,10 +99,14 @@ } {0} ##################################################################### file delete -force test.db +if {[catch {sqlite3 db test.db -vfs unix-flock} msg]} { + finish_test + return +} do_test lock5-flock.1 { sqlite3 db test.db -vfs unix-flock execsql { CREATE TABLE t1(a, b);