From 6e59b6267ddaf75a441178a82e07fa0041585f59 Mon Sep 17 00:00:00 2001 From: Arthur Zakirov Date: Wed, 8 Aug 2018 17:30:48 +0300 Subject: [PATCH] Fix various compile time typos --- src/backup.c | 16 ++++++++++------ src/parsexlog.c | 2 +- src/pg_probackup.h | 8 +++----- src/utils/logger.c | 1 - src/utils/logger.h | 3 +++ src/utils/parray.c | 3 ++- src/utils/parray.h | 4 ++++ 7 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/backup.c b/src/backup.c index 20163b5d..4bed3523 100644 --- a/src/backup.c +++ b/src/backup.c @@ -543,9 +543,11 @@ do_backup_instance(void) if (ptrack_lsn > prev_backup->stop_lsn || ptrack_lsn == InvalidXLogRecPtr) { - elog(ERROR, "LSN from ptrack_control %lx differs from STOP LSN of previous backup %lx.\n" + elog(ERROR, "LSN from ptrack_control %X/%X differs from STOP LSN of previous backup %X/%X.\n" "Create new full backup before an incremental one.", - ptrack_lsn, prev_backup->stop_lsn); + (uint32) (ptrack_lsn >> 32), (uint32) (ptrack_lsn), + (uint32) (prev_backup->stop_lsn >> 32), + (uint32) (prev_backup->stop_lsn)); } } @@ -1032,11 +1034,13 @@ check_system_identifiers(void) system_id_conn = get_remote_system_identifier(backup_conn); if (system_id_conn != system_identifier) - elog(ERROR, "Backup data directory was initialized for system id %ld, but connected instance system id is %ld", - system_identifier, system_id_conn); + elog(ERROR, "Backup data directory was initialized for system id " UINT64_FORMAT ", " + "but connected instance system id is " UINT64_FORMAT, + system_identifier, system_id_conn); if (system_id_pgdata != system_identifier) - elog(ERROR, "Backup data directory was initialized for system id %ld, but target backup directory system id is %ld", - system_identifier, system_id_pgdata); + elog(ERROR, "Backup data directory was initialized for system id " UINT64_FORMAT ", " + "but target backup directory system id is " UINT64_FORMAT, + system_identifier, system_id_pgdata); } /* diff --git a/src/parsexlog.c b/src/parsexlog.c index 3e5e8790..254eb663 100644 --- a/src/parsexlog.c +++ b/src/parsexlog.c @@ -897,7 +897,7 @@ PrintXLogCorruptionMsg(XLogPageReadPrivate *private_data, int elevel) "Error has occured during reading WAL segment \"%s\"", private_data->xlogpath); #ifdef HAVE_LIBZ - else if (private_data->gz_xlogpath != NULL) + else if (private_data->gz_xlogfile != NULL) elog(elevel, "Possible WAL corruption. " "Error has occured during reading WAL segment \"%s\"", private_data->gz_xlogpath); diff --git a/src/pg_probackup.h b/src/pg_probackup.h index 9da22ad6..650f8a5e 100644 --- a/src/pg_probackup.h +++ b/src/pg_probackup.h @@ -63,8 +63,6 @@ #define PG_BLACK_LIST "black_list" #define PG_TABLESPACE_MAP_FILE "tablespace_map" -#define LOG_FILENAME_DEFAULT "pg_probackup.log" -#define LOG_DIRECTORY_DEFAULT "log" /* Direcotry/File permission */ #define DIR_PERMISSION (0700) #define FILE_PERMISSION (0600) @@ -206,7 +204,7 @@ typedef struct pgBackupConfig typedef struct pgBackup pgBackup; /* Information about single backup stored in backup.conf */ -typedef struct pgBackup +struct pgBackup { BackupMode backup_mode; /* Mode - one of BACKUP_MODE_xxx above*/ time_t backup_id; /* Identifier of the backup. @@ -255,7 +253,7 @@ typedef struct pgBackup pgBackup *parent_backup_link; char *primary_conninfo; /* Connection parameters of the backup * in the format suitable for recovery.conf */ -} pgBackup; +}; /* Recovery target for restore and validate subcommands */ typedef struct pgRecoveryTarget @@ -406,7 +404,7 @@ extern void process_block_change(ForkNumber forknum, RelFileNode rnode, BlockNumber blkno); extern char *pg_ptrack_get_block(backup_files_arg *arguments, - Oid dbOid, Oid tblsOid, Oid relOid, + Oid dbOid, Oid tblsOid, Oid relOid, BlockNumber blknum, size_t *result_size); /* in restore.c */ diff --git a/src/utils/logger.c b/src/utils/logger.c index 31669ed0..5862343e 100644 --- a/src/utils/logger.c +++ b/src/utils/logger.c @@ -15,7 +15,6 @@ #include "logger.h" #include "pgut.h" -#include "pg_probackup.h" #include "thread.h" /* Logger parameters */ diff --git a/src/utils/logger.h b/src/utils/logger.h index 8643ad18..9259d455 100644 --- a/src/utils/logger.h +++ b/src/utils/logger.h @@ -42,6 +42,9 @@ extern int log_rotation_age; #define LOG_LEVEL_CONSOLE_DEFAULT INFO #define LOG_LEVEL_FILE_DEFAULT LOG_OFF +#define LOG_FILENAME_DEFAULT "pg_probackup.log" +#define LOG_DIRECTORY_DEFAULT "log" + #undef elog extern void elog(int elevel, const char *fmt, ...) pg_attribute_printf(2, 3); extern void elog_file(int elevel, const char *fmt, ...) pg_attribute_printf(2, 3); diff --git a/src/utils/parray.c b/src/utils/parray.c index a9ba7c8e..969f83a7 100644 --- a/src/utils/parray.c +++ b/src/utils/parray.c @@ -7,7 +7,8 @@ *------------------------------------------------------------------------- */ -#include "src/pg_probackup.h" +#include "parray.h" +#include "pgut.h" /* members of struct parray are hidden from client. */ struct parray diff --git a/src/utils/parray.h b/src/utils/parray.h index 833a6961..70338757 100644 --- a/src/utils/parray.h +++ b/src/utils/parray.h @@ -10,6 +10,10 @@ #ifndef PARRAY_H #define PARRAY_H +#include "postgres_fe.h" + +#include + /* * "parray" hold pointers to objects in a linear memory area. * Client use "parray *" to access parray object.