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-Tag: REL7_4_3~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ce822372f2b701f5e7140e3275e0fa21b0fbe63;p=thirdparty%2Fpostgresql.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 3b43d3051b9..ac18d7bfa0e 100644 --- a/src/port/fseeko.c +++ b/src/port/fseeko.c @@ -8,7 +8,7 @@ * * * 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 flockfile(stream); #endif + fflush(stream); /* force writes to fd for stat() */ if (fstat(fileno(stream), &filestat) != 0) goto failure; floc = filestat.st_size;