aboutsummaryrefslogtreecommitdiff
path: root/contrib/test_shm_mq/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/test_shm_mq/test.c')
-rw-r--r--contrib/test_shm_mq/test.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/contrib/test_shm_mq/test.c b/contrib/test_shm_mq/test.c
index 1832e1d1dba..8750bae8dbf 100644
--- a/contrib/test_shm_mq/test.c
+++ b/contrib/test_shm_mq/test.c
@@ -18,8 +18,7 @@
#include "test_shm_mq.h"
-PG_MODULE_MAGIC;
-PG_FUNCTION_INFO_V1(test_shm_mq);
+PG_MODULE_MAGIC; PG_FUNCTION_INFO_V1(test_shm_mq);
PG_FUNCTION_INFO_V1(test_shm_mq_pipelined);
void _PG_init(void);
@@ -47,7 +46,7 @@ test_shm_mq(PG_FUNCTION_ARGS)
dsm_segment *seg;
shm_mq_handle *outqh;
shm_mq_handle *inqh;
- shm_mq_result res;
+ shm_mq_result res;
Size len;
void *data;
@@ -59,8 +58,8 @@ test_shm_mq(PG_FUNCTION_ARGS)
/*
* Since this test sends data using the blocking interfaces, it cannot
- * send data to itself. Therefore, a minimum of 1 worker is required.
- * Of course, a negative worker count is nonsensical.
+ * send data to itself. Therefore, a minimum of 1 worker is required. Of
+ * course, a negative worker count is nonsensical.
*/
if (nworkers < 1)
ereport(ERROR,
@@ -139,7 +138,7 @@ test_shm_mq_pipelined(PG_FUNCTION_ARGS)
dsm_segment *seg;
shm_mq_handle *outqh;
shm_mq_handle *inqh;
- shm_mq_result res;
+ shm_mq_result res;
Size len;
void *data;
@@ -204,8 +203,8 @@ test_shm_mq_pipelined(PG_FUNCTION_ARGS)
}
else if (res == SHM_MQ_DETACHED)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not receive message")));
+ (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not receive message")));
}
else
{
@@ -216,18 +215,18 @@ test_shm_mq_pipelined(PG_FUNCTION_ARGS)
if (send_count != receive_count)
ereport(ERROR,
(errcode(ERRCODE_INTERNAL_ERROR),
- errmsg("message sent %d times, but received %d times",
- send_count, receive_count)));
+ errmsg("message sent %d times, but received %d times",
+ send_count, receive_count)));
break;
}
if (wait)
{
/*
- * If we made no progress, wait for one of the other processes
- * to which we are connected to set our latch, indicating that
- * they have read or written data and therefore there may now be
- * work for us to do.
+ * If we made no progress, wait for one of the other processes to
+ * which we are connected to set our latch, indicating that they
+ * have read or written data and therefore there may now be work
+ * for us to do.
*/
WaitLatch(&MyProc->procLatch, WL_LATCH_SET, 0);
CHECK_FOR_INTERRUPTS();
@@ -247,13 +246,13 @@ test_shm_mq_pipelined(PG_FUNCTION_ARGS)
static void
verify_message(Size origlen, char *origdata, Size newlen, char *newdata)
{
- Size i;
+ Size i;
if (origlen != newlen)
ereport(ERROR,
(errmsg("message corrupted"),
errdetail("The original message was %zu bytes but the final message is %zu bytes.",
- origlen, newlen)));
+ origlen, newlen)));
for (i = 0; i < origlen; ++i)
if (origdata[i] != newdata[i])