Skip to content

Commit 8507c2f

Browse files
committed
Improve readability and error messages in pg_backup_start_time.
Gurjeet Singh, with corrections by me.
1 parent c616d85 commit 8507c2f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/backend/access/transam/xlogfuncs.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,14 +611,18 @@ pg_backup_start_time(PG_FUNCTION_ARGS)
611611
break;
612612
}
613613

614-
/*
615-
* Close the backup label file.
616-
*/
617-
if (ferror(lfp) || FreeFile(lfp))
614+
/* Check for a read error. */
615+
if (ferror(lfp))
618616
ereport(ERROR,
619617
(errcode_for_file_access(),
620618
errmsg("could not read file \"%s\": %m", BACKUP_LABEL_FILE)));
621619

620+
/* Close the backup label file. */
621+
if (FreeFile(lfp))
622+
ereport(ERROR,
623+
(errcode_for_file_access(),
624+
errmsg("could not close file \"%s\": %m", BACKUP_LABEL_FILE)));
625+
622626
if (strlen(backup_start_time) == 0)
623627
ereport(ERROR,
624628
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy