fflush() FILE buffer to descriptor so stat call gets proper size in fseeko.c.
authorBruce Momjian <[email protected]>
Tue, 23 Mar 2004 05:27:02 +0000 (05:27 +0000)
committerBruce Momjian <[email protected]>
Tue, 23 Mar 2004 05:27:02 +0000 (05:27 +0000)
Fixed problem with pg_dump tar backups.  Only happens on platforms that
use our port/fseeko.c, which is currently BSD/OS and NetBSD.

src/port/fseeko.c

index 3692d1d0c1b632daf5bf3f3032c4a1df8198e207..8fe2c4789a3eece81b485b618e544153625fd573 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header$
+ *       $PostgreSQL$
  *
  *-------------------------------------------------------------------------
  */
@@ -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;