Refactor code checking for file existence
authorMichael Paquier
Fri, 12 Jan 2024 03:04:51 +0000 (12:04 +0900)
committerMichael Paquier
Fri, 12 Jan 2024 03:04:51 +0000 (12:04 +0900)
commite72a37528ddaadd796be73fe9b0a0c08b18476d2
treef1e827966b3b0e02ed56b6cfbe96e9f266d6e610
parent08c3ad27eb5348d0cbffa843a3edb11534f9904a
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: https://postgr.es/m/[email protected]
src/backend/jit/jit.c
src/backend/storage/file/fd.c
src/backend/utils/fmgr/dfmgr.c
src/include/storage/fd.h