changeset 826:d38c8ce61e4e

Add check for pthread-safety of lib pgsql
author Sebastien Decugis <sdecugis@freediameter.net>
date Tue, 18 Sep 2012 22:33:02 +0200
parents 034a475a3eb0
children a8ed055a9253
files extensions/app_acct/acct_db.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/extensions/app_acct/acct_db.c	Thu Sep 13 22:09:32 2012 +0200
+++ b/extensions/app_acct/acct_db.c	Tue Sep 18 22:33:02 2012 +0200
@@ -77,6 +77,11 @@
 	TRACE_ENTRY();
 	CHECK_PARAMS( acct_config && acct_config->conninfo && acct_config->tablename ); 
 	
+	CHECK_PARAMS_DO( PQisthreadsafe() == 1, {
+		fd_log_debug("You PostGreSQL installation is not thread-safe!\n");
+		return EINVAL;
+	} );			
+	
 	/* Use the information from acct_config to create the connection and prepare the query */
 	conn = PQconnectdb(acct_config->conninfo);
 	
"Welcome to our mercurial repository"