$NetBSD: patch-ad,v 1.1 2007/02/19 08:38:49 joerg Exp $

--- sqlite/os_unix.c.orig	2006-12-13 19:53:18.000000000 +0000
+++ sqlite/os_unix.c
@@ -494,6 +494,7 @@ static int lockTrace(int fd, int op, str
 #define fcntl lockTrace
 #endif /* SQLITE_LOCK_TRACE */
 
+#if SQLITE_THREAD_OVERRIDE_LOCK == -1
 /*
 ** The testThreadLockingBehavior() routine launches two separate
 ** threads on this routine.  This routine attempts to lock a file
@@ -534,6 +535,7 @@ static void testThreadLockingBehavior(in
   close(fd);
   threadsOverrideEachOthersLocks =  d[0].result==0 && d[1].result==0;
 }
+#endif
 #endif /* SQLITE_UNIX_THREADS */
 
 /*
@@ -662,9 +664,11 @@ static int findLockInfo(
   key1.dev = statbuf.st_dev;
   key1.ino = statbuf.st_ino;
 #ifdef SQLITE_UNIX_THREADS
+#if SQLITE_THREAD_OVERRIDE_LOCK == -1
   if( threadsOverrideEachOthersLocks<0 ){
     testThreadLockingBehavior(fd);
   }
+#endif
   key1.tid = threadsOverrideEachOthersLocks ? 0 : pthread_self();
 #endif
   memset(&key2, 0, sizeof(key2));
