More autosize structure error checks.
This commit is contained in:
parent
37e8621623
commit
4eadf2d6cd
@ -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)
|
|||||||
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user