mirror of
https://github.com/postgres/postgres.git
synced 2025-06-23 14:01:44 +03:00
Allow fseeko in pg_dump only if fseeko() will work for all supported file
sizes.
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.59 2002/10/22 19:15:23 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.60 2002/10/25 01:33:17 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -2338,6 +2338,32 @@ ReadHead(ArchiveHandle *AH)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* checkSeek
|
||||
* check to see if fseek can be performed.
|
||||
*/
|
||||
|
||||
bool
|
||||
checkSeek(FILE *fp)
|
||||
{
|
||||
|
||||
if (fseek(fp, 0, SEEK_CUR) != 0)
|
||||
return false;
|
||||
else if (sizeof(off_t) > sizeof(long))
|
||||
/*
|
||||
* At this point, off_t is too large for long, so we return
|
||||
* based on whether an off_t version of fseek is available.
|
||||
*/
|
||||
#ifdef HAVE_FSEEKO
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_SortToc(ArchiveHandle *AH, TocSortCompareFn fn)
|
||||
{
|
||||
|
Reference in New Issue
Block a user