Skip to content
Snippets Groups Projects
Commit 4eadf2d6 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

More autosize structure error checks.

parent 37e86216
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.5 1997/01/23 18:14:40 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.6 1997/01/25 21:01:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -136,7 +136,10 @@ InitBufferPool(IPCKey key) ...@@ -136,7 +136,10 @@ InitBufferPool(IPCKey key)
int i; int i;
/* check padding of BufferDesc and BufferHdr */ /* check padding of BufferDesc and BufferHdr */
if (sizeof(struct sbufdesc) != PADDED_SBUFDESC_SIZE) /* we need both checks because a sbufdesc_padded > PADDED_SBUFDESC_SIZE
will shrink sbufdesc to the required size, which is bad */
if (sizeof(struct sbufdesc) != PADDED_SBUFDESC_SIZE ||
sizeof(struct sbufdesc_padded) > PADDED_SBUFDESC_SIZE)
elog(WARN,"Internal error: sbufdesc does not have the proper size, " elog(WARN,"Internal error: sbufdesc does not have the proper size, "
"contact the Postgres developers"); "contact the Postgres developers");
if (sizeof(struct sbufdesc_unpadded) <= PADDED_SBUFDESC_SIZE/2) if (sizeof(struct sbufdesc_unpadded) <= PADDED_SBUFDESC_SIZE/2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment