Commit f489470f authored by Heikki Linnakangas's avatar Heikki Linnakangas

Fix Windows build.

Was broken by my xloginsert scaling patch. XLogCtl global variable needs
to be initialized in each process, as it's not inherited by fork() on
Windows.
parent b5ed2199
...@@ -5074,7 +5074,8 @@ XLOGShmemInit(void) ...@@ -5074,7 +5074,8 @@ XLOGShmemInit(void)
ControlFile = (ControlFileData *) ControlFile = (ControlFileData *)
ShmemInitStruct("Control File", sizeof(ControlFileData), &foundCFile); ShmemInitStruct("Control File", sizeof(ControlFileData), &foundCFile);
allocptr = ShmemInitStruct("XLOG Ctl", XLOGShmemSize(), &foundXLog); XLogCtl = (XLogCtlData *)
ShmemInitStruct("XLOG Ctl", XLOGShmemSize(), &foundXLog);
if (foundCFile || foundXLog) if (foundCFile || foundXLog)
{ {
...@@ -5082,7 +5083,6 @@ XLOGShmemInit(void) ...@@ -5082,7 +5083,6 @@ XLOGShmemInit(void)
Assert(foundCFile && foundXLog); Assert(foundCFile && foundXLog);
return; return;
} }
XLogCtl = (XLogCtlData *) allocptr;
memset(XLogCtl, 0, sizeof(XLogCtlData)); memset(XLogCtl, 0, sizeof(XLogCtlData));
/* /*
...@@ -5090,7 +5090,7 @@ XLOGShmemInit(void) ...@@ -5090,7 +5090,7 @@ XLOGShmemInit(void)
* multiple of the alignment for same, so no extra alignment padding is * multiple of the alignment for same, so no extra alignment padding is
* needed here. * needed here.
*/ */
allocptr += sizeof(XLogCtlData); allocptr = ((char *) XLogCtl) + sizeof(XLogCtlData);
XLogCtl->xlblocks = (XLogRecPtr *) allocptr; XLogCtl->xlblocks = (XLogRecPtr *) allocptr;
memset(XLogCtl->xlblocks, 0, sizeof(XLogRecPtr) * XLOGbuffers); memset(XLogCtl->xlblocks, 0, sizeof(XLogRecPtr) * XLOGbuffers);
allocptr += sizeof(XLogRecPtr) * XLOGbuffers; allocptr += sizeof(XLogRecPtr) * XLOGbuffers;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment