From 757fb0e5a9a61ac8d3a67e334faeea6dc0084b3f Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Sun, 14 Mar 2004 12:16:30 +0000 Subject: - Fixed Informix compat math functions to cope with the situations where one argument takes the result. - Applied thread patches by Lee Kindness --- src/interfaces/ecpg/ecpglib/misc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/interfaces/ecpg/ecpglib/misc.c') diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c index a388e70aaff..c912c5d0b4b 100644 --- a/src/interfaces/ecpg/ecpglib/misc.c +++ b/src/interfaces/ecpg/ecpglib/misc.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.18 2003/11/29 19:52:08 pgsql Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.19 2004/03/14 12:16:30 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -118,10 +118,15 @@ ECPGinit(const struct connection * con, const char *connection_name, const int l } #ifdef ENABLE_THREAD_SAFETY -static void -ecpg_sqlca_key_init(void) +static void *ecpg_sqlca_key_destructor(void *arg) { - pthread_key_create(&sqlca_key, NULL); + if( arg != NULL ) + free(arg); /* sqlca structure allocated in ECPGget_sqlca */ +} + +static void ecpg_sqlca_key_init(void) +{ + pthread_key_create(&sqlca_key, ecpg_sqlca_key_destructor); } #endif -- cgit v1.2.3