> Please update year for the license in pg_controllog.c
License updated for files pg_controllog.c, controllog_utils.c, pg_controllog.h, controllog_utils.h.
> +check_file_exists(const char *datadir, const char *path) > There is existing helper function such as: > src/backend/utils/fmgr/dfmgr.c:static bool file_exists(const char *name); > Is it possible to reuse that code ?
There are a lot of functions that check the file existence:
But there is no unified function: different components use their own function with their own specific. Probably we can not reuse code of dfmgr.c:file_exists() because this function skip "errno == EACCES" (this error is critical for us). I copied for src/bin/pg_rewind/file_ops.c:check_file_exists() code of function jit.c:file_exists() (with adaptation for the utility).