From 211fb08433198000e41d4aaddff08b80f7f7fb3f Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 1 Apr 2011 09:04:36 +0000 Subject: [PATCH] Fix some problems in os_unix.c when compiled with ENABLE_LOCKING_STYLE on OSX. Also some minor issues with test scripts. FossilOrigin-Name: 8088031bc949bd4efb5edf33bbd1bce5700fca56 --- install-sh | 0 manifest | 26 +++++++++++++------------- manifest.uuid | 2 +- src/os_unix.c | 4 +++- src/test_hexio.c | 7 ++++++- test/badutf2.test | 8 +++++--- test/oserror.test | 12 +++++++++--- test/progress.test | 0 tool/mkopts.tcl | 0 9 files changed, 37 insertions(+), 22 deletions(-) mode change 100644 => 100755 install-sh mode change 100755 => 100644 test/progress.test mode change 100755 => 100644 tool/mkopts.tcl diff --git a/install-sh b/install-sh old mode 100644 new mode 100755 diff --git a/manifest b/manifest index 03779ff4cb..a3f317b4e1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stwo\scompiler\serrors\sassociated\swith\snon-standard\scompile-time\soptions. -D 2011-04-01T02:26:36.020 +C Fix\ssome\sproblems\sin\sos_unix.c\swhen\scompiled\swith\sENABLE_LOCKING_STYLE\son\sOSX.\sAlso\ssome\sminor\sissues\swith\stest\sscripts. +D 2011-04-01T09:04:37 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 27701a1653595a1f2187dc61c8117e00a6c1d50f F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -99,7 +99,7 @@ F ext/rtree/rtree_util.tcl 06aab2ed5b826545bf215fff90ecb9255a8647ea F ext/rtree/sqlite3rtree.h 1af0899c63a688e272d69d8e746f24e76f10a3f0 F ext/rtree/tkt3363.test 142ab96eded44a3615ec79fba98c7bde7d0f96de F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024 -F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 +F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F main.mk 7e4d4d0433c9cbfd906c6451a7cc50310a8f4555 F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a @@ -162,7 +162,7 @@ F src/os.c 22ac61d06e72a0dac900400147333b07b13d8e1d F src/os.h 9dbed8c2b9c1f2f2ebabc09e49829d4777c26bf9 F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f F src/os_os2.c 2596fd2d5d0976c6c0c628d0c3c7c4e7a724f4cf -F src/os_unix.c be9f9d3383a7b556a1f3805442e0061e436eb7ac +F src/os_unix.c 9a129123a054572d4d8cf1766fb093b0e45ab57c F src/os_win.c 24d72407a90551969744cf9bcbb1b4c72c5fa845 F src/pager.c 6aa906b60a59664ba58d3f746164bb010d407ce1 F src/pager.h 3f8c783de1d4706b40b1ac15b64f5f896bcc78d1 @@ -202,7 +202,7 @@ F src/test_config.c 62f0f8f934b1d5c7e4cd4f506ae453a1117b47d7 F src/test_demovfs.c 0aed671636735116fc872c5b03706fd5612488b5 F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc F src/test_func.c cbdec5cededa0761daedde5baf06004a9bf416b5 -F src/test_hexio.c 1237f000ec7a491009b1233f5c626ea71bce1ea2 +F src/test_hexio.c c4773049603151704a6ab25ac5e936b5109caf5a F src/test_init.c 5d624ffd0409d424cf9adbfe1f056b200270077c F src/test_intarray.c d879bbf8e4ce085ab966d1f3c896a7c8b4f5fc99 F src/test_intarray.h 489edb9068bb926583445cb02589344961054207 @@ -282,7 +282,7 @@ F test/backup2.test b7c69f937c912e85ac8a5dbd1e1cf290302b2d49 F test/backup_ioerr.test 1f012e692f42c0442ae652443258f70e9f20fa38 F test/backup_malloc.test 7162d604ec2b4683c4b3799a48657fb8b5e2d450 F test/badutf.test d5360fc31f643d37a973ab0d8b4fb85799c3169f -F test/badutf2.test a47fda0d986d5325aa0ec2a0ebdd2d68db45e623 +F test/badutf2.test f5bc7f2d280670ecd79b9cf4f0f1760c607fe51f F test/between.test 16b1776c6323faadb097a52d673e8e3d8be7d070 F test/bigfile.test a8ec8073a20207456dab01a29ad9cde42b0dd103 F test/bigrow.test f0aeb7573dcb8caaafea76454be3ade29b7fc747 @@ -589,7 +589,7 @@ F test/notnull.test cc7c78340328e6112a13c3e311a9ab3127114347 F test/null.test a8b09b8ed87852742343b33441a9240022108993 F test/omitunique.test bbb2ec4345d9125d9ee21cd9488d97a163020d5f F test/openv2.test af02ed0a9cbc0d2a61b8f35171d4d117e588e4ec -F test/oserror.test d1f085bdbac20456fccdf5877f52016453654fc3 +F test/oserror.test 6c61c859cd94864cfd6af83e0549e2800238c413 F test/pager1.test d8672fd0af5f4f9b99b06283d00f01547809bebe F test/pager2.test 745b911dde3d1f24ae0870bd433dfa83d7c658c1 F test/pager3.test 3856d9c80839be0668efee1b74811b1b7f7fc95f @@ -604,7 +604,7 @@ F test/permutations.test 5b2a4cb756ffb2407cb4743163668d1d769febb6 F test/pragma.test fdfc09067ea104a0c247a1a79d8093b56656f850 F test/pragma2.test 5364893491b9231dd170e3459bfc2e2342658b47 F test/printf.test 05970cde31b1a9f54bd75af60597be75a5c54fea -F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301 x +F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301 F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc F test/quick.test 1681febc928d686362d50057c642f77a02c62e57 F test/quota.test ddafe133653093eb9a99ccd6264884ae43f9c9b8 @@ -895,7 +895,7 @@ F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/lemon.c dfd81a51b6e27e469ba21d01a75ddf092d429027 F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc F tool/mkkeywordhash.c d2e6b4a5965e23afb80fbe74bb54648cd371f309 -F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e x +F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c.tcl cf44512a48112b1ba09590548660a5a6877afdb3 F tool/mksqlite3h.tcl d76c226a5e8e1f3b5f6593bcabe5e98b3b1ec9ff @@ -920,7 +920,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 4dc148bb4cec5ecba167cdcb4959a4f0fa05a96f -R 6db83e8558722fd3bd0df3d6934e094c -U drh -Z 0287bc47bbe647ced5d0be0c2b89e260 +P e3bf2d5ce4f87535e030a446e03d911f421805f7 +R c7b1df6afcd246671bef4e02c46ac2c9 +U dan +Z f228344db51d960df69afeb4fae2d9e8 diff --git a/manifest.uuid b/manifest.uuid index 2a0b140594..cf5632fe46 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e3bf2d5ce4f87535e030a446e03d911f421805f7 \ No newline at end of file +8088031bc949bd4efb5edf33bbd1bce5700fca56 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index bf11e678af..4799181072 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1594,7 +1594,7 @@ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){ lock.l_whence = SEEK_SET; lock.l_start = SHARED_FIRST; lock.l_len = divSize; - if( unixFileLock(pFile,, &lock)==(-1) ){ + if( unixFileLock(pFile, &lock)==(-1) ){ tErrno = errno; rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); if( IS_LOCK_ERROR(rc) ){ @@ -5747,7 +5747,9 @@ static int proxyCreateUnixFile( } memset(pNew, 0, sizeof(unixFile)); pNew->openFlags = openFlags; + memset(&dummyVfs, 0, sizeof(dummyVfs)); dummyVfs.pAppData = (void*)&autolockIoFinder; + dummyVfs.zName = "dummy"; pUnused->fd = fd; pUnused->flags = openFlags; pNew->pUnused = pUnused; diff --git a/src/test_hexio.c b/src/test_hexio.c index 02bd60c8aa..e3258e869e 100644 --- a/src/test_hexio.c +++ b/src/test_hexio.c @@ -312,8 +312,13 @@ static int utf8_to_utf8( sqlite3TestBinToHex(z,nOut); Tcl_AppendResult(interp, (char*)z, 0); sqlite3_free(z); -#endif return TCL_OK; +#else + Tcl_AppendResult(interp, + "[utf8_to_utf8] unavailable - SQLITE_DEBUG not defined", 0 + ); + return TCL_ERROR; +#endif } static int getFts3Varint(const char *p, sqlite_int64 *v){ diff --git a/test/badutf2.test b/test/badutf2.test index 462e98892e..36b40fb95c 100644 --- a/test/badutf2.test +++ b/test/badutf2.test @@ -105,9 +105,11 @@ foreach { i len uval xstr ustr u2u } { utf8_to_ustr2 [ sqlite3_column_text $S 0 ] } $ustr - do_test badutf2-5.1.$i { - utf8_to_utf8 $uval - } $u2u + ifcapable debug { + do_test badutf2-5.1.$i { + utf8_to_utf8 $uval + } $u2u + } } diff --git a/test/oserror.test b/test/oserror.test index ecb02116ba..d1952a30dd 100644 --- a/test/oserror.test +++ b/test/oserror.test @@ -44,7 +44,12 @@ proc do_re_test {tn script expression} { # Tests oserror-1.* test failures in the open() system call. # -# Test a failure in open() due to too many files. +# Test a failure in open() due to too many files. +# +# The xOpen() method of the unix VFS calls getcwd() as well as open(). +# Although this does not appear to be documented in the man page, on OSX +# a call to getcwd() may fail if there are no free file descriptors. So +# an error may be reported for either open() or getcwd() here. # do_test 1.1.1 { set ::log [list] @@ -55,8 +60,9 @@ do_test 1.1.1 { do_test 1.1.2 { catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } } } {1} - -do_re_test 1.1.3 { lindex $::log 0 } {^os_unix.c:\d+: \(\d+\) open\(.*test.db\) - } +do_re_test 1.1.3 { + lindex $::log 0 +} {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - } # Test a failure in open() due to the path being a directory. diff --git a/test/progress.test b/test/progress.test old mode 100755 new mode 100644 diff --git a/tool/mkopts.tcl b/tool/mkopts.tcl old mode 100755 new mode 100644 -- 2.47.2