aboutsummaryrefslogtreecommitdiff
path: root/contrib/basic_archive/basic_archive.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/basic_archive/basic_archive.c')
-rw-r--r--contrib/basic_archive/basic_archive.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/contrib/basic_archive/basic_archive.c b/contrib/basic_archive/basic_archive.c
index e7efbfb9c34..c2173533228 100644
--- a/contrib/basic_archive/basic_archive.c
+++ b/contrib/basic_archive/basic_archive.c
@@ -40,8 +40,8 @@
PG_MODULE_MAGIC;
-void _PG_init(void);
-void _PG_archive_module_init(ArchiveModuleCallbacks *cb);
+void _PG_init(void);
+void _PG_archive_module_init(ArchiveModuleCallbacks *cb);
static char *archive_directory = NULL;
static MemoryContext basic_archive_context;
@@ -102,8 +102,8 @@ check_archive_directory(char **newval, void **extra, GucSource source)
/*
* The default value is an empty string, so we have to accept that value.
- * Our check_configured callback also checks for this and prevents archiving
- * from proceeding if it is still empty.
+ * Our check_configured callback also checks for this and prevents
+ * archiving from proceeding if it is still empty.
*/
if (*newval == NULL || *newval[0] == '\0')
return true;
@@ -119,7 +119,7 @@ check_archive_directory(char **newval, void **extra, GucSource source)
}
/*
- * Do a basic sanity check that the specified archive directory exists. It
+ * Do a basic sanity check that the specified archive directory exists. It
* could be removed at some point in the future, so we still need to be
* prepared for it not to exist in the actual archiving logic.
*/
@@ -155,18 +155,19 @@ basic_archive_file(const char *file, const char *path)
MemoryContext oldcontext;
/*
- * We run basic_archive_file_internal() in our own memory context so that we
- * can easily reset it during error recovery (thus avoiding memory leaks).
+ * We run basic_archive_file_internal() in our own memory context so that
+ * we can easily reset it during error recovery (thus avoiding memory
+ * leaks).
*/
oldcontext = MemoryContextSwitchTo(basic_archive_context);
/*
- * Since the archiver operates at the bottom of the exception stack, ERRORs
- * turn into FATALs and cause the archiver process to restart. However,
- * using ereport(ERROR, ...) when there are problems is easy to code and
- * maintain. Therefore, we create our own exception handler to catch ERRORs
- * and return false instead of restarting the archiver whenever there is a
- * failure.
+ * Since the archiver operates at the bottom of the exception stack,
+ * ERRORs turn into FATALs and cause the archiver process to restart.
+ * However, using ereport(ERROR, ...) when there are problems is easy to
+ * code and maintain. Therefore, we create our own exception handler to
+ * catch ERRORs and return false instead of restarting the archiver
+ * whenever there is a failure.
*/
if (sigsetjmp(local_sigjmp_buf, 1) != 0)
{
@@ -228,14 +229,14 @@ basic_archive_file_internal(const char *file, const char *path)
snprintf(destination, MAXPGPATH, "%s/%s", archive_directory, file);
/*
- * First, check if the file has already been archived. If it already exists
- * and has the same contents as the file we're trying to archive, we can
- * return success (after ensuring the file is persisted to disk). This
- * scenario is possible if the server crashed after archiving the file but
- * before renaming its .ready file to .done.
+ * First, check if the file has already been archived. If it already
+ * exists and has the same contents as the file we're trying to archive,
+ * we can return success (after ensuring the file is persisted to disk).
+ * This scenario is possible if the server crashed after archiving the
+ * file but before renaming its .ready file to .done.
*
- * If the archive file already exists but has different contents, something
- * might be wrong, so we just fail.
+ * If the archive file already exists but has different contents,
+ * something might be wrong, so we just fail.
*/
if (stat(destination, &st) == 0)
{
@@ -274,8 +275,8 @@ basic_archive_file_internal(const char *file, const char *path)
archive_directory, "archtemp", file, MyProcPid, epoch);
/*
- * Copy the file to its temporary destination. Note that this will fail if
- * temp already exists.
+ * Copy the file to its temporary destination. Note that this will fail
+ * if temp already exists.
*/
copy_file(unconstify(char *, path), temp);
@@ -318,9 +319,9 @@ compare_files(const char *file1, const char *file2)
for (;;)
{
- int nbytes = 0;
- int buf1_len = 0;
- int buf2_len = 0;
+ int nbytes = 0;
+ int buf1_len = 0;
+ int buf2_len = 0;
while (buf1_len < CMP_BUF_SIZE)
{