v1-0004-ecpg-Improve-variable-name.patch
text/x-patch
Filename: v1-0004-ecpg-Improve-variable-name.patch
Type: text/x-patch
Part: 3
Message:
pg_threads.h take II
Patch
Format: format-patch
Series: patch v1-0004
Subject: ecpg: Improve variable name.
| File | + | − |
|---|---|---|
| src/interfaces/ecpg/ecpglib/connect.c | 6 | 6 |
From 6b12ef6f04c8ac91ac4122aff7e190f879c640de Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Wed, 24 Jun 2026 17:43:53 +1200
Subject: [PATCH v1 04/14] ecpg: Improve variable name.
Rename actual_connection to actual_connection_global, to contrast more
clearly with the change that will follow. Separated from main change to
avoid cluttering the diff.
Discussion:
Reviewed-by:
---
src/interfaces/ecpg/ecpglib/connect.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index 78de9f298ba..36b97fcdba0 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -17,7 +17,7 @@ locale_t ecpg_clocale = (locale_t) 0;
static pthread_mutex_t connections_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_key_t actual_connection_key;
static pthread_once_t actual_connection_key_once = PTHREAD_ONCE_INIT;
-static struct connection *actual_connection = NULL;
+static struct connection *actual_connection_global = NULL;
static struct connection *all_connections = NULL;
static void
@@ -50,7 +50,7 @@ ecpg_get_connection_nr(const char *connection_name)
*/
if (ret == NULL)
/* no TSD connection, going for global */
- ret = actual_connection;
+ ret = actual_connection_global;
}
else
{
@@ -90,7 +90,7 @@ ecpg_get_connection(const char *connection_name)
*/
if (ret == NULL)
/* no TSD connection here either, using global */
- ret = actual_connection;
+ ret = actual_connection_global;
}
else
{
@@ -134,8 +134,8 @@ ecpg_finish(struct connection *act)
if (pthread_getspecific(actual_connection_key) == act)
pthread_setspecific(actual_connection_key, all_connections);
- if (actual_connection == act)
- actual_connection = all_connections;
+ if (actual_connection_global == act)
+ actual_connection_global = all_connections;
ecpg_log("ecpg_finish: connection %s closed\n", act->name ? act->name : "(null)");
@@ -548,7 +548,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
all_connections = this;
pthread_setspecific(actual_connection_key, all_connections);
- actual_connection = all_connections;
+ actual_connection_global = all_connections;
ecpg_log("ECPGconnect: opening database %s on %s port %s %s%s %s%s\n",
realname ? realname : "<DEFAULT>",
--
2.47.3