summaryrefslogtreecommitdiff
path: root/src/bin/pg_basebackup
diff options
context:
space:
mode:
authorBruce Momjian2012-06-10 19:20:04 +0000
committerBruce Momjian2012-06-10 19:20:04 +0000
commit927d61eeff78363ea3938c818d07e511ebaf75cf (patch)
tree2f0bcecf53327f76272a8ce690fa62505520fab9 /src/bin/pg_basebackup
parent60801944fa105252b48ea5688d47dfc05c695042 (diff)
Run pgindent on 9.2 source tree in preparation for first 9.3
commit-fest.
Diffstat (limited to 'src/bin/pg_basebackup')
-rw-r--r--src/bin/pg_basebackup/pg_basebackup.c9
-rw-r--r--src/bin/pg_basebackup/pg_receivexlog.c13
-rw-r--r--src/bin/pg_basebackup/receivelog.c25
-rw-r--r--src/bin/pg_basebackup/receivelog.h16
-rw-r--r--src/bin/pg_basebackup/streamutil.c4
5 files changed, 34 insertions, 33 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index c3a0d89897a..66a281477a7 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -63,6 +63,7 @@ static pid_t bgchild = -1;
/* End position for xlog streaming, empty string if unknown yet */
static XLogRecPtr xlogendptr;
+
#ifndef WIN32
static int has_xlogendptr = 0;
#else
@@ -223,14 +224,14 @@ typedef struct
char xlogdir[MAXPGPATH];
char *sysidentifier;
int timeline;
-} logstreamer_param;
+} logstreamer_param;
static int
-LogStreamerMain(logstreamer_param * param)
+LogStreamerMain(logstreamer_param *param)
{
if (!ReceiveXlogStream(param->bgconn, param->startptr, param->timeline,
param->sysidentifier, param->xlogdir,
- reached_end_position, standby_message_timeout, true))
+ reached_end_position, standby_message_timeout, true))
/*
* Any errors will already have been reported in the function process,
@@ -1092,7 +1093,7 @@ BaseBackup(void)
int status;
int r;
#else
- DWORD status;
+ DWORD status;
#endif
if (verbose)
diff --git a/src/bin/pg_basebackup/pg_receivexlog.c b/src/bin/pg_basebackup/pg_receivexlog.c
index 67a70bcf713..1acb7ccb56f 100644
--- a/src/bin/pg_basebackup/pg_receivexlog.c
+++ b/src/bin/pg_basebackup/pg_receivexlog.c
@@ -92,7 +92,7 @@ stop_streaming(XLogRecPtr segendpos, uint32 timeline, bool segment_finished)
/*
* Determine starting location for streaming, based on:
* 1. If there are existing xlog segments, start at the end of the last one
- * that is complete (size matches XLogSegSize)
+ * that is complete (size matches XLogSegSize)
* 2. If no valid xlog exists, start from the beginning of the current
* WAL segment.
*/
@@ -190,9 +190,10 @@ FindStreamingStart(XLogRecPtr currentpos, uint32 currenttimeline)
if (high_log > 0 || high_seg > 0)
{
XLogRecPtr high_ptr;
+
/*
- * Move the starting pointer to the start of the next segment,
- * since the highest one we've seen was completed.
+ * Move the starting pointer to the start of the next segment, since
+ * the highest one we've seen was completed.
*/
NextLogSeg(high_log, high_seg);
@@ -284,7 +285,6 @@ sigint_handler(int signum)
{
time_to_abort = true;
}
-
#endif
int
@@ -413,9 +413,10 @@ main(int argc, char **argv)
{
StreamLog();
if (time_to_abort)
+
/*
- * We've been Ctrl-C'ed. That's not an error, so exit without
- * an errorcode.
+ * We've been Ctrl-C'ed. That's not an error, so exit without an
+ * errorcode.
*/
exit(0);
else if (noloop)
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c
index a51a40edfd1..9dd94e11406 100644
--- a/src/bin/pg_basebackup/receivelog.c
+++ b/src/bin/pg_basebackup/receivelog.c
@@ -52,7 +52,7 @@ open_walfile(XLogRecPtr startpoint, uint32 timeline, char *basedir, char *namebu
{
int f;
char fn[MAXPGPATH];
- struct stat statbuf;
+ struct stat statbuf;
char *zerobuf;
int bytes;
@@ -80,7 +80,7 @@ open_walfile(XLogRecPtr startpoint, uint32 timeline, char *basedir, char *namebu
return -1;
}
if (statbuf.st_size == XLogSegSize)
- return f; /* File is open and ready to use */
+ return f; /* File is open and ready to use */
if (statbuf.st_size != 0)
{
fprintf(stderr, _("%s: WAL segment %s is %d bytes, should be 0 or %d\n"),
@@ -147,8 +147,8 @@ close_walfile(int walfile, char *basedir, char *walname, bool segment_complete)
}
/*
- * Rename the .partial file only if we've completed writing the
- * whole segment or segment_complete is true.
+ * Rename the .partial file only if we've completed writing the whole
+ * segment or segment_complete is true.
*/
if (currpos == XLOG_SEG_SIZE || segment_complete)
{
@@ -202,7 +202,7 @@ localGetCurrentTimestamp(void)
*/
static void
localTimestampDifference(TimestampTz start_time, TimestampTz stop_time,
- long *secs, int *microsecs)
+ long *secs, int *microsecs)
{
TimestampTz diff = stop_time - start_time;
@@ -229,8 +229,8 @@ localTimestampDifference(TimestampTz start_time, TimestampTz stop_time,
*/
static bool
localTimestampDifferenceExceeds(TimestampTz start_time,
- TimestampTz stop_time,
- int msec)
+ TimestampTz stop_time,
+ int msec)
{
TimestampTz diff = stop_time - start_time;
@@ -392,14 +392,14 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, char *sysi
FD_SET(PQsocket(conn), &input_mask);
if (standby_message_timeout)
{
- TimestampTz targettime;
+ TimestampTz targettime;
targettime = TimestampTzPlusMilliseconds(last_status,
- standby_message_timeout - 1);
+ standby_message_timeout - 1);
localTimestampDifference(now,
targettime,
&timeout.tv_sec,
- (int *)&timeout.tv_usec);
+ (int *) &timeout.tv_usec);
if (timeout.tv_sec <= 0)
timeout.tv_sec = 1; /* Always sleep at least 1 sec */
timeoutptr = &timeout;
@@ -444,9 +444,8 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, char *sysi
if (copybuf[0] == 'k')
{
/*
- * keepalive message, sent in 9.2 and newer. We just ignore
- * this message completely, but need to skip past it in the
- * stream.
+ * keepalive message, sent in 9.2 and newer. We just ignore this
+ * message completely, but need to skip past it in the stream.
*/
if (r != STREAMING_KEEPALIVE_SIZE)
{
diff --git a/src/bin/pg_basebackup/receivelog.h b/src/bin/pg_basebackup/receivelog.h
index 0a803ee4ac1..7176a68beaa 100644
--- a/src/bin/pg_basebackup/receivelog.h
+++ b/src/bin/pg_basebackup/receivelog.h
@@ -4,13 +4,13 @@
* Called before trying to read more data or when a segment is
* finished. Return true to stop streaming.
*/
-typedef bool (*stream_stop_callback)(XLogRecPtr segendpos, uint32 timeline, bool segment_finished);
+typedef bool (*stream_stop_callback) (XLogRecPtr segendpos, uint32 timeline, bool segment_finished);
extern bool ReceiveXlogStream(PGconn *conn,
- XLogRecPtr startpos,
- uint32 timeline,
- char *sysidentifier,
- char *basedir,
- stream_stop_callback stream_stop,
- int standby_message_timeout,
- bool rename_partial);
+ XLogRecPtr startpos,
+ uint32 timeline,
+ char *sysidentifier,
+ char *basedir,
+ stream_stop_callback stream_stop,
+ int standby_message_timeout,
+ bool rename_partial);
diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index 1416faa2e3c..1b4a9d240b3 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -164,8 +164,8 @@ GetConnection(void)
free(keywords);
/*
- * Ensure we have the same value of integer timestamps as the
- * server we are connecting to.
+ * Ensure we have the same value of integer timestamps as the server
+ * we are connecting to.
*/
tmpparam = PQparameterStatus(tmpconn, "integer_datetimes");
if (!tmpparam)