Commit ee455f81 authored by Bruce Momjian's avatar Bruce Momjian

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.
parent fd4f3b3b
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/port/fseeko.c,v 1.13 2003/11/29 19:52:13 pgsql Exp $ * $PostgreSQL: pgsql/src/port/fseeko.c,v 1.14 2004/03/23 05:26:53 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -68,6 +68,7 @@ fseeko(FILE *stream, off_t offset, int whence) ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment