aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2022-08-26 02:35:40 +1200
committerDavid Rowley <drowley@postgresql.org>2022-08-26 02:35:40 +1200
commit3e0fff2e6888e39b0ad5cdfdb78bc1c2bb2b22c9 (patch)
tree235e23ee1c87eb2f148216535c0d300bcbe0a64e /src/backend/access/transam
parente3ce2de09d814f8770b2e3b3c152b7671bcdb83f (diff)
downloadpostgresql-3e0fff2e6888e39b0ad5cdfdb78bc1c2bb2b22c9.tar.gz
postgresql-3e0fff2e6888e39b0ad5cdfdb78bc1c2bb2b22c9.zip
More -Wshadow=compatible-local warning fixes
In a similar effort to f01592f91, here we're targetting fixing the warnings where we've deemed the shadowing variable to serve a close enough purpose to the shadowed variable just to reuse the shadowed version and not declare the shadowing variable at all. By my count, this takes the warning count from 106 down to 71. Author: Justin Pryzby Discussion: https://postgr.es/m/20220825020839.GT2342@telsasoft.com
Diffstat (limited to 'src/backend/access/transam')
-rw-r--r--src/backend/access/transam/multixact.c1
-rw-r--r--src/backend/access/transam/xlog.c4
2 files changed, 1 insertions, 4 deletions
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 8f7d12950e5..ec57f56adf3 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -1614,7 +1614,6 @@ mXactCachePut(MultiXactId multi, int nmembers, MultiXactMember *members)
if (MXactCacheMembers++ >= MAX_CACHE_ENTRIES)
{
dlist_node *node;
- mXactCacheEnt *entry;
node = dlist_tail_node(&MXactCache);
dlist_delete(node);
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 87b243e0d4b..537845cada7 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -3036,8 +3036,7 @@ XLogFileInitInternal(XLogSegNo logsegno, TimeLineID logtli,
pgstat_report_wait_start(WAIT_EVENT_WAL_INIT_SYNC);
if (pg_fsync(fd) != 0)
{
- int save_errno = errno;
-
+ save_errno = errno;
close(fd);
errno = save_errno;
ereport(ERROR,
@@ -4721,7 +4720,6 @@ XLogInitNewTimeline(TimeLineID endTLI, XLogRecPtr endOfLog, TimeLineID newTLI)
if (close(fd) != 0)
{
- char xlogfname[MAXFNAMELEN];
int save_errno = errno;
XLogFileName(xlogfname, newTLI, startLogSegNo, wal_segment_size);