]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Remove useless lstat() call in pg_rewind.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 6 Sep 2020 15:50:41 +0000 (11:50 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 6 Sep 2020 15:50:41 +0000 (11:50 -0400)
commit7d60e4183013c8b1316daf4ec0d08ef245d3b92c
tree7a0c58e5ceb47f7f10e8c4214c5f1d05c984976e
parent546479f34f5c960494687f5808eb7b3d054478a1
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
src/bin/pg_rewind/filemap.c