2323 * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
2424 * Portions Copyright (c) 1994, Regents of the University of California
2525 *
26- * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.41 2006/04/03 23:35:04 tgl Exp $
26+ * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.42 2006/04/04 22:39:59 tgl Exp $
2727 *
2828 *-------------------------------------------------------------------------
2929 */
@@ -365,9 +365,9 @@ ReadControlFile(void)
365365 }
366366
367367 /* Use malloc to ensure we have a maxaligned buffer */
368- buffer = (char * ) malloc (BLCKSZ );
368+ buffer = (char * ) malloc (PG_CONTROL_SIZE );
369369
370- len = read (fd , buffer , BLCKSZ );
370+ len = read (fd , buffer , PG_CONTROL_SIZE );
371371 if (len < 0 )
372372 {
373373 fprintf (stderr , _ ("%s: could not read file \"%s\": %s\n" ),
@@ -546,7 +546,7 @@ static void
546546RewriteControlFile (void )
547547{
548548 int fd ;
549- char buffer [BLCKSZ ]; /* need not be aligned */
549+ char buffer [PG_CONTROL_SIZE ]; /* need not be aligned */
550550
551551 /*
552552 * Adjust fields as needed to force an empty XLOG starting at the next
@@ -587,21 +587,21 @@ RewriteControlFile(void)
587587 FIN_CRC32 (ControlFile .crc );
588588
589589 /*
590- * We write out BLCKSZ bytes into pg_control, zero-padding the excess over
591- * sizeof(ControlFileData). This reduces the odds of premature-EOF errors
592- * when reading pg_control. We'll still fail when we check the contents
593- * of the file, but hopefully with a more specific error than "couldn't
594- * read pg_control".
590+ * We write out PG_CONTROL_SIZE bytes into pg_control, zero-padding the
591+ * excess over sizeof(ControlFileData). This reduces the odds of
592+ * premature-EOF errors when reading pg_control. We'll still fail when we
593+ * check the contents of the file, but hopefully with a more specific
594+ * error than "couldn't read pg_control".
595595 */
596- if (sizeof (ControlFileData ) > BLCKSZ )
596+ if (sizeof (ControlFileData ) > PG_CONTROL_SIZE )
597597 {
598598 fprintf (stderr ,
599- _ ("%s: internal error -- sizeof(ControlFileData) is too large ... fix xlog.c \n" ),
599+ _ ("%s: internal error -- sizeof(ControlFileData) is too large ... fix PG_CONTROL_SIZE \n" ),
600600 progname );
601601 exit (1 );
602602 }
603603
604- memset (buffer , 0 , BLCKSZ );
604+ memset (buffer , 0 , PG_CONTROL_SIZE );
605605 memcpy (buffer , & ControlFile , sizeof (ControlFileData ));
606606
607607 unlink (XLOG_CONTROL_FILE );
@@ -617,7 +617,7 @@ RewriteControlFile(void)
617617 }
618618
619619 errno = 0 ;
620- if (write (fd , buffer , BLCKSZ ) != BLCKSZ )
620+ if (write (fd , buffer , PG_CONTROL_SIZE ) != PG_CONTROL_SIZE )
621621 {
622622 /* if write didn't set errno, assume problem is no disk space */
623623 if (errno == 0 )
0 commit comments