More autosize structure error checks.

This commit is contained in:
Bruce Momjian 1997-01-25 21:01:16 +00:00
parent 37e8621623
commit 4eadf2d6cd
1 changed files with 5 additions and 2 deletions

View File

@ -7,7 +7,7 @@
*
*
* 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)
int i;
/* 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, "
"contact the Postgres developers");
if (sizeof(struct sbufdesc_unpadded) <= PADDED_SBUFDESC_SIZE/2)