1515 *
1616 *
1717 * IDENTIFICATION
18- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.141 2007/02/01 19:10:28 momjian Exp $
18+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.142 2007/02/19 15:05:06 mha Exp $
1919 *
2020 *-------------------------------------------------------------------------
2121 */
@@ -1311,24 +1311,24 @@ TocIDRequired(ArchiveHandle *AH, DumpId id, RestoreOptions *ropt)
13111311}
13121312
13131313size_t
1314- WriteOffset (ArchiveHandle * AH , off_t o , int wasSet )
1314+ WriteOffset (ArchiveHandle * AH , pgoff_t o , int wasSet )
13151315{
13161316 int off ;
13171317
13181318 /* Save the flag */
13191319 (* AH -> WriteBytePtr ) (AH , wasSet );
13201320
1321- /* Write out off_t smallest byte first, prevents endian mismatch */
1322- for (off = 0 ; off < sizeof (off_t ); off ++ )
1321+ /* Write out pgoff_t smallest byte first, prevents endian mismatch */
1322+ for (off = 0 ; off < sizeof (pgoff_t ); off ++ )
13231323 {
13241324 (* AH -> WriteBytePtr ) (AH , o & 0xFF );
13251325 o >>= 8 ;
13261326 }
1327- return sizeof (off_t ) + 1 ;
1327+ return sizeof (pgoff_t ) + 1 ;
13281328}
13291329
13301330int
1331- ReadOffset (ArchiveHandle * AH , off_t * o )
1331+ ReadOffset (ArchiveHandle * AH , pgoff_t * o )
13321332{
13331333 int i ;
13341334 int off ;
@@ -1348,8 +1348,8 @@ ReadOffset(ArchiveHandle *AH, off_t *o)
13481348 else if (i == 0 )
13491349 return K_OFFSET_NO_DATA ;
13501350
1351- /* Cast to off_t because it was written as an int. */
1352- * o = (off_t ) i ;
1351+ /* Cast to pgoff_t because it was written as an int. */
1352+ * o = (pgoff_t ) i ;
13531353 return K_OFFSET_POS_SET ;
13541354 }
13551355
@@ -1379,8 +1379,8 @@ ReadOffset(ArchiveHandle *AH, off_t *o)
13791379 */
13801380 for (off = 0 ; off < AH -> offSize ; off ++ )
13811381 {
1382- if (off < sizeof (off_t ))
1383- * o |= ((off_t ) ((* AH -> ReadBytePtr ) (AH ))) << (off * 8 );
1382+ if (off < sizeof (pgoff_t ))
1383+ * o |= ((pgoff_t ) ((* AH -> ReadBytePtr ) (AH ))) << (off * 8 );
13841384 else
13851385 {
13861386 if ((* AH -> ReadBytePtr ) (AH ) != 0 )
@@ -1647,7 +1647,7 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
16471647 AH -> createDate = time (NULL );
16481648
16491649 AH -> intSize = sizeof (int );
1650- AH -> offSize = sizeof (off_t );
1650+ AH -> offSize = sizeof (pgoff_t );
16511651 if (FileSpec )
16521652 {
16531653 AH -> fSpec = strdup (FileSpec );
@@ -2768,11 +2768,11 @@ checkSeek(FILE *fp)
27682768
27692769 if (fseeko (fp , 0 , SEEK_CUR ) != 0 )
27702770 return false;
2771- else if (sizeof (off_t ) > sizeof (long ))
2771+ else if (sizeof (pgoff_t ) > sizeof (long ))
27722772
27732773 /*
2774- * At this point, off_t is too large for long, so we return based on
2775- * whether an off_t version of fseek is available.
2774+ * At this point, pgoff_t is too large for long, so we return based on
2775+ * whether an pgoff_t version of fseek is available.
27762776 */
27772777#ifdef HAVE_FSEEKO
27782778 return true;
0 commit comments