From: Bruce Momjian Date: Tue, 23 Mar 2004 05:27:02 +0000 (+0000) Subject: fflush() FILE buffer to descriptor so stat call gets proper size in fseeko.c. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=7246001cd6b3125a47bed7219348f15f0bf6acd6;p=users%2Fbernd%2Fpostgres.git 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. --- diff --git a/src/port/fseeko.c b/src/port/fseeko.c index 3692d1d0c1..8fe2c4789a 100644 --- a/src/port/fseeko.c +++ b/src/port/fseeko.c @@ -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;