summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/pgstat.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2019-03-25 09:35:29 +0100
committerPeter Eisentraut <peter@eisentraut.org>2019-03-25 09:37:03 +0100
commit481018f2804065cb5ed1cde75b7c0596aeef959a (patch)
tree045013c91eb4fe8747a7b4ab0a5e36cd44d3d078 /src/backend/postmaster/pgstat.c
parent572e3e6634e55accf95e2bcfb1340019c86a21dc (diff)
Add macro to cast away volatile without allowing changes to underlying type
This adds unvolatize(), which works just like unconstify() but for volatile. Discussion: https://www.postgresql.org/message-id/flat/7a5cbea7-b8df-e910-0f10-04014bcad701%402ndquadrant.com
Diffstat (limited to 'src/backend/postmaster/pgstat.c')
-rw-r--r--src/backend/postmaster/pgstat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 2fbfadd9f0c..2a8472b91ae 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -3311,7 +3311,7 @@ pgstat_read_current_status(void)
localentry->backendStatus.st_procpid = beentry->st_procpid;
if (localentry->backendStatus.st_procpid > 0)
{
- memcpy(&localentry->backendStatus, (char *) beentry, sizeof(PgBackendStatus));
+ memcpy(&localentry->backendStatus, unvolatize(PgBackendStatus *, beentry), sizeof(PgBackendStatus));
/*
* strcpy is safe even if the string is modified concurrently,