aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/misc.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2004-03-14 12:16:30 +0000
committerMichael Meskes <meskes@postgresql.org>2004-03-14 12:16:30 +0000
commit757fb0e5a9a61ac8d3a67e334faeea6dc0084b3f (patch)
tree36660558226b311fd6fabc7a11f700f3dc177775 /src/interfaces/ecpg/ecpglib/misc.c
parent80ac9b06acb20da700a86251d58b2eae1506b727 (diff)
downloadpostgresql-757fb0e5a9a61ac8d3a67e334faeea6dc0084b3f.tar.gz
postgresql-757fb0e5a9a61ac8d3a67e334faeea6dc0084b3f.zip
- Fixed Informix compat math functions to cope with the situations
where one argument takes the result. - Applied thread patches by Lee Kindness
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/misc.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/misc.c13
1 files changed, 9 insertions, 4 deletions
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