Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee455f8

Browse files
committed
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.
1 parent fd4f3b3 commit ee455f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/port/fseeko.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/port/fseeko.c,v 1.13 2003/11/29 19:52:13 pgsql Exp $
11+
* $PostgreSQL: pgsql/src/port/fseeko.c,v 1.14 2004/03/23 05:26:53 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -68,6 +68,7 @@ fseeko(FILE *stream, off_t offset, int whence)
6868
#ifdef bsdi
6969
flockfile(stream);
7070
#endif
71+
fflush(stream); /* force writes to fd for stat() */
7172
if (fstat(fileno(stream), &filestat) != 0)
7273
goto failure;
7374
floc = filestat.st_size;

0 commit comments

Comments
 (0)