aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authormistachkin <mistachkin@noemail.net>2015-01-12 18:52:57 +0000
committermistachkin <mistachkin@noemail.net>2015-01-12 18:52:57 +0000
commit9b97b8fed970afe1edcae8b49281c072b92c93d0 (patch)
tree5e933832179cd56eb86c79d942f73df4d9c36dcc /src/tclsqlite.c
parent7bb6e8e16962d2201a5d61d5e02a52b4d453786c (diff)
parent8d9da63dacde128e546f84cb34392188aab1be83 (diff)
downloadsqlite-9b97b8fed970afe1edcae8b49281c072b92c93d0.tar.gz
sqlite-9b97b8fed970afe1edcae8b49281c072b92c93d0.zip
Merge updates from trunk.
FossilOrigin-Name: ca5f2c545216c82486e66d26f55b49cbf351ffdc
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 32de52730..852f966a8 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -3813,6 +3813,11 @@ static void init_all(Tcl_Interp *interp){
#endif
}
+/* Needed for the setrlimit() system call on unix */
+#if defined(unix)
+#include <sys/resource.h>
+#endif
+
#define TCLSH_MAIN main /* Needed to fake out mktclapp */
int TCLSH_MAIN(int argc, char **argv){
Tcl_Interp *interp;
@@ -3826,6 +3831,17 @@ int TCLSH_MAIN(int argc, char **argv){
}
#endif
+ /* Since the primary use case for this binary is testing of SQLite,
+ ** be sure to generate core files if we crash */
+#if defined(SQLITE_TEST) && defined(unix)
+ { struct rlimit x;
+ getrlimit(RLIMIT_CORE, &x);
+ x.rlim_cur = x.rlim_max;
+ setrlimit(RLIMIT_CORE, &x);
+ }
+#endif /* SQLITE_TEST && unix */
+
+
/* Call sqlite3_shutdown() once before doing anything else. This is to
** test that sqlite3_shutdown() can be safely called by a process before
** sqlite3_initialize() is. */