git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c616d85)
Improve readability and error messages in pg_backup_start_time.
2012年6月14日 19:20:08 +0000 (15:20 -0400)
2012年6月14日 19:20:08 +0000 (15:20 -0400)
Gurjeet Singh, with corrections by me.


diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c
index d94809ad7ee23d4017ba6d2f475f1f5d39875a2a..adf0b16e56a052db68196d33fc7236e7bdbf7218 100644 (file)
--- a/src/backend/access/transam/xlogfuncs.c
+++ b/src/backend/access/transam/xlogfuncs.c
@@ -611,14 +611,18 @@ pg_backup_start_time(PG_FUNCTION_ARGS)
break;
}
- /*
- * Close the backup label file.
- */
- if (ferror(lfp) || FreeFile(lfp))
+ /* Check for a read error. */
+ if (ferror(lfp))
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not read file \"%s\": %m", BACKUP_LABEL_FILE)));
+ /* Close the backup label file. */
+ if (FreeFile(lfp))
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not close file \"%s\": %m", BACKUP_LABEL_FILE)));
+
if (strlen(backup_start_time) == 0)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /