From 71424ec1a4cf4138577b00ed417993f69dfc8936 Mon Sep 17 00:00:00 2001 From: pk910 Date: Sat, 14 Jan 2012 18:49:23 +0100 Subject: [PATCH] fixed mysqlConn.c (no-threads mode) --- src/mysqlConn.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mysqlConn.c b/src/mysqlConn.c index 3c3a5a8..5fc14e9 100644 --- a/src/mysqlConn.c +++ b/src/mysqlConn.c @@ -264,7 +264,12 @@ char* escape_string(const char *str) { struct mysql_conn_struct *get_mysql_conn_struct() { SYNCHRONIZE(synchronized); struct mysql_conn_struct *mysql_conn; - unsigned long tid = syscall(SYS_gettid); + unsigned long tid; + #ifdef HAVE_THREADS + tid = syscall(SYS_gettid); + #else + tid = 1; + #endif for(mysql_conn = mysql_conns; mysql_conn; mysql_conn = mysql_conn->next) { if(mysql_conn->tid == tid) { DESYNCHRONIZE(synchronized); -- 2.20.1