pgsql: Refactor code checking for file existence

Started by Michael Paquierover 2 years ago1 messagescomitters
Jump to latest
#1Michael Paquier
michael@paquier.xyz

Refactor code checking for file existence

jit.c and dfgr.c had a copy of the same code to check if a file exists
or not, with a twist: jit.c did not check for EACCES when failing the
stat() call for the path whose existence is tested. This refactored
routine will be used by an upcoming patch.

Reviewed-by: Ashutosh Bapat
Discussion: /messages/by-id/ZTiV8tn_MIb_H2rE@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e72a37528ddaadd796be73fe9b0a0c08b18476d2

Modified Files
--------------
src/backend/jit/jit.c | 20 +-------------------
src/backend/storage/file/fd.c | 23 +++++++++++++++++++++++
src/backend/utils/fmgr/dfmgr.c | 25 ++++---------------------
src/include/storage/fd.h | 1 +
4 files changed, 29 insertions(+), 40 deletions(-)