1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-03 01:21:48 +03:00

Avoid shadowing a variable in sync.c.

It was confusing to reuse the variable name 'entry' in two scopes.
Use distinct variable names.

Reported-by: Ranier Vilela <ranier.vf@gmail.com>
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Reported-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/CAEudQArDrFyQ15Am3rgWBunGBVZFDb90onTS8SRiFAWHeiLiFA%40mail.gmail.com
This commit is contained in:
Thomas Munro 2022-07-12 16:17:36 +12:00
parent 7bae3bbf62
commit 5794491058

View File

@ -510,26 +510,26 @@ RememberSyncRequest(const FileTag *ftag, SyncRequestType type)
else if (type == SYNC_FILTER_REQUEST) else if (type == SYNC_FILTER_REQUEST)
{ {
HASH_SEQ_STATUS hstat; HASH_SEQ_STATUS hstat;
PendingFsyncEntry *entry; PendingFsyncEntry *pfe;
ListCell *cell; ListCell *cell;
/* Cancel matching fsync requests */ /* Cancel matching fsync requests */
hash_seq_init(&hstat, pendingOps); hash_seq_init(&hstat, pendingOps);
while ((entry = (PendingFsyncEntry *) hash_seq_search(&hstat)) != NULL) while ((pfe = (PendingFsyncEntry *) hash_seq_search(&hstat)) != NULL)
{ {
if (entry->tag.handler == ftag->handler && if (pfe->tag.handler == ftag->handler &&
syncsw[ftag->handler].sync_filetagmatches(ftag, &entry->tag)) syncsw[ftag->handler].sync_filetagmatches(ftag, &pfe->tag))
entry->canceled = true; pfe->canceled = true;
} }
/* Cancel matching unlink requests */ /* Cancel matching unlink requests */
foreach(cell, pendingUnlinks) foreach(cell, pendingUnlinks)
{ {
PendingUnlinkEntry *entry = (PendingUnlinkEntry *) lfirst(cell); PendingUnlinkEntry *pue = (PendingUnlinkEntry *) lfirst(cell);
if (entry->tag.handler == ftag->handler && if (pue->tag.handler == ftag->handler &&
syncsw[ftag->handler].sync_filetagmatches(ftag, &entry->tag)) syncsw[ftag->handler].sync_filetagmatches(ftag, &pue->tag))
entry->canceled = true; pue->canceled = true;
} }
} }
else if (type == SYNC_UNLINK_REQUEST) else if (type == SYNC_UNLINK_REQUEST)