From: dan Date: Fri, 1 Apr 2011 16:50:07 +0000 (+0000) Subject: When simulating an error in the close() system call, close the file descriptor anyway... X-Git-Tag: version-3.7.6~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f18749542f4a5e535ccb43cf82ea6beda7418599;p=thirdparty%2Fsqlite.git When simulating an error in the close() system call, close the file descriptor anyway. Otherwise long running tests leak too many file-descriptors and crash. FossilOrigin-Name: 81ddbf43366c18ebdd46558d6a0fbee2ce6a4c4e --- diff --git a/manifest b/manifest index 179b8e01d2..dcaa2e9d59 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Ensure\sthat\sit\sis\snot\spossible\sto\sadd\sa\scolumn\sto\sa\ssystem\stable\susing\sALTER\sTABLE. -D 2011-04-01T15:15:58.380 +C When\ssimulating\san\serror\sin\sthe\sclose()\ssystem\scall,\sclose\sthe\sfile\sdescriptor\sanyway.\sOtherwise\slong\srunning\stests\sleak\stoo\smany\sfile-descriptors\sand\scrash. +D 2011-04-01T16:50:07 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 27701a1653595a1f2187dc61c8117e00a6c1d50f F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -220,7 +220,7 @@ F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0 F src/test_server.c bbba05c144b5fc4b52ff650a4328027b3fa5fcc6 F src/test_stat.c f682704b5d1ba8e1d4e7e882a6d7922e2dcf066c F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd -F src/test_syscall.c 349a2b913e82b029f01527f58f65d66a02a09a84 +F src/test_syscall.c 61bb14684142a19c580a13b4dde680044d37e0f5 F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa F src/test_thread.c bedd05cad673dba53326f3aa468cc803038896c0 F src/test_vfs.c 2ed8853c1e51ac6f9ea091f7ce4e0d618bba8b86 @@ -896,7 +896,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 @@ -921,7 +921,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 7e237aea22084416d02b89d5223de4e1ca76882d -R 68179f8f20bd7e83c0daf30e8b4b7cff +P d9707ef8dcd29667b6d366897f6ad02c87aa0041 +R 61773a6586c7ffae758339f441c619af U dan -Z 07da6539f8d6e81dde928bab49d2b3fe +Z 4a1b718c29bc9f24adfbad40e4254b98 diff --git a/manifest.uuid b/manifest.uuid index e4175092fa..6f0caefd4a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d9707ef8dcd29667b6d366897f6ad02c87aa0041 \ No newline at end of file +81ddbf43366c18ebdd46558d6a0fbee2ce6a4c4e \ No newline at end of file diff --git a/src/test_syscall.c b/src/test_syscall.c index dbac01d69b..a757e66a5a 100644 --- a/src/test_syscall.c +++ b/src/test_syscall.c @@ -214,6 +214,12 @@ static int ts_open(const char *zFile, int flags, int mode){ */ static int ts_close(int fd){ if( tsIsFail() ){ + /* Even if simulating an error, close the original file-descriptor. + ** This is to stop the test process from running out of file-descriptors + ** when running a long test. If a call to close() appears to fail, SQLite + ** never attempts to use the file-descriptor afterwards (or even to close + ** it a second time). */ + orig_close(fd); return -1; } return orig_close(fd); diff --git a/tool/mkopts.tcl b/tool/mkopts.tcl old mode 100755 new mode 100644