@@ -153,7 +153,7 @@ get_current_timeline(bool safe)
153153 size_t size ;
154154
155155 /* First fetch file... */
156- buffer = slurpFile (instance_config .pgdata , "global/pg_control" , & size ,
156+ buffer = slurpFile (instance_config .pgdata , XLOG_CONTROL_FILE , & size ,
157157 safe , FIO_DB_HOST );
158158 if (safe && buffer == NULL )
159159 return 0 ;
@@ -196,7 +196,7 @@ get_checkpoint_location(PGconn *conn)
196196 size_t size ;
197197 ControlFileData ControlFile ;
198198
199- buffer = fetchFile ( conn , "global/pg_control" , & size );
199+ buffer = slurpFile ( instance_config . pgdata , XLOG_CONTROL_FILE , & size , false, FIO_DB_HOST );
200200 digestControlFile (& ControlFile , buffer , size );
201201 pg_free (buffer );
202202
@@ -212,7 +212,7 @@ get_system_identifier(const char *pgdata_path)
212212 size_t size ;
213213
214214 /* First fetch file... */
215- buffer = slurpFile (pgdata_path , "global/pg_control" , & size , false, FIO_DB_HOST );
215+ buffer = slurpFile (pgdata_path , XLOG_CONTROL_FILE , & size , false, FIO_DB_HOST );
216216 if (buffer == NULL )
217217 return 0 ;
218218 digestControlFile (& ControlFile , buffer , size );
@@ -246,7 +246,7 @@ get_remote_system_identifier(PGconn *conn)
246246 size_t size ;
247247 ControlFileData ControlFile ;
248248
249- buffer = fetchFile ( conn , "global/pg_control" , & size );
249+ buffer = slurpFile ( instance_config . pgdata , XLOG_CONTROL_FILE , & size , false, FIO_DB_HOST );
250250 digestControlFile (& ControlFile , buffer , size );
251251 pg_free (buffer );
252252
@@ -263,9 +263,7 @@ get_xlog_seg_size(char *pgdata_path)
263263 size_t size ;
264264
265265 /* First fetch file... */
266- buffer = slurpFile (pgdata_path , "global/pg_control" , & size , false, FIO_DB_HOST );
267- if (buffer == NULL )
268- return 0 ;
266+ buffer = slurpFile (pgdata_path , XLOG_CONTROL_FILE , & size , false, FIO_DB_HOST );
269267 digestControlFile (& ControlFile , buffer , size );
270268 pg_free (buffer );
271269
@@ -283,7 +281,7 @@ get_data_checksum_version(bool safe)
283281 size_t size ;
284282
285283 /* First fetch file... */
286- buffer = slurpFile (instance_config .pgdata , "global/pg_control" , & size ,
284+ buffer = slurpFile (instance_config .pgdata , XLOG_CONTROL_FILE , & size ,
287285 safe , FIO_DB_HOST );
288286 if (buffer == NULL )
289287 return 0 ;
@@ -301,9 +299,8 @@ get_pgcontrol_checksum(const char *pgdata_path)
301299 size_t size ;
302300
303301 /* First fetch file... */
304- buffer = slurpFile (pgdata_path , "global/pg_control" , & size , false, FIO_BACKUP_HOST );
305- if (buffer == NULL )
306- return 0 ;
302+ buffer = slurpFile (pgdata_path , XLOG_CONTROL_FILE , & size , false, FIO_BACKUP_HOST );
303+
307304 digestControlFile (& ControlFile , buffer , size );
308305 pg_free (buffer );
309306
@@ -325,9 +322,6 @@ set_min_recovery_point(pgFile *file, const char *backup_path,
325322
326323 /* First fetch file content */
327324 buffer = slurpFile (instance_config .pgdata , XLOG_CONTROL_FILE , & size , false, FIO_DB_HOST );
328- if (buffer == NULL )
329- elog (ERROR , "ERROR" );
330-
331325 digestControlFile (& ControlFile , buffer , size );
332326
333327 elog (LOG , "Current minRecPoint %X/%X" ,
0 commit comments