fflush() FILE buffer to descriptor so stat call gets proper size in fseeko.c.

Fixed problem with pg_dump tar backups.  Only happens on platforms that
use our port/fseeko.c, which is currently BSD/OS and NetBSD.
This commit is contained in:
Bruce Momjian 2004-03-23 05:27:02 +00:00
parent b96509a3f3
commit 7ce822372f

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/port/fseeko.c,v 1.12 2003/08/04 02:40:20 momjian Exp $ * $PostgreSQL: pgsql/src/port/fseeko.c,v 1.12.4.1 2004/03/23 05:27:02 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -68,6 +68,7 @@ fseeko(FILE *stream, off_t offset, int whence)
#ifdef bsdi #ifdef bsdi
flockfile(stream); flockfile(stream);
#endif #endif
fflush(stream); /* force writes to fd for stat() */
if (fstat(fileno(stream), &filestat) != 0) if (fstat(fileno(stream), &filestat) != 0)
goto failure; goto failure;
floc = filestat.st_size; floc = filestat.st_size;