pgsql: Remove useless lstat() call in pg_rewind.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove useless lstat() call in pg_rewind.
Date: 2020-09-06 15:51:00
Message-ID: E1kEwwW-0001mG-EM@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove useless lstat() call in pg_rewind.

This is duplicative of an lstat that was just done by the calling
function (traverse_datadir), besides which we weren't really doing
anything with the results. There's not much point in checking to
see if someone removed the file since the previous lstat, since the
FILE_ACTION_REMOVE code would have to deal with missing-file cases
anyway. Moreover, the "exists = false" assignment was a dead store;
nothing was done with that value later.

A syscall saved is a syscall earned, so back-patch to 9.5
where this code was introduced.

Discussion: https://postgr.es/m/1221796.1599329320@sss.pgh.pa.us

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/75e44b471c511bc2aec0e869ab0d23d249890734

Modified Files
--------------
src/bin/pg_rewind/filemap.c | 12 ------------
1 file changed, 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-09-06 16:56:43 pgsql: Fix misleading error message about inconsistent moving-aggregate
Previous Message Peter Eisentraut 2020-09-06 14:57:47 pgsql: doc: Don't hide the "Up" link when it is the same as "Home"