aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-03-23 05:26:53 +0000
committerBruce Momjian <bruce@momjian.us>2004-03-23 05:26:53 +0000
commitee455f81a58d5e135d2d00c9a59d70c4713bfe3b (patch)
tree16432948b52d5d498259c62e02e8b8a2785f2346
parentfd4f3b3b62febbd360ad9b75409f7dde22546c23 (diff)
downloadpostgresql-ee455f81a58d5e135d2d00c9a59d70c4713bfe3b.tar.gz
postgresql-ee455f81a58d5e135d2d00c9a59d70c4713bfe3b.zip
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.
-rw-r--r--src/port/fseeko.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/port/fseeko.c b/src/port/fseeko.c
index 9bb8a110bf7..af35dd67cca 100644
--- a/src/port/fseeko.c
+++ b/src/port/fseeko.c
@@ -8,7 +8,7 @@
*
*
* 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)
#ifdef bsdi
flockfile(stream);
#endif
+ fflush(stream); /* force writes to fd for stat() */
if (fstat(fileno(stream), &filestat) != 0)
goto failure;
floc = filestat.st_size;