I just fixed a problem with our port/fseeko.c code.

I added an fflush() so the FILE buffer would update the file descriptor
so stat() gets proper size in fseeko.c.

This fixes a problem with pg_dump tar backups.  Only happens on
platforms that use our port/fseeko.c, which is currently BSD/OS and
NetBSD.  The error would be:

        $ pg_dump -Ft test >/dev/null
        pg_dump: [tar archiver] actual file length (2171) does not match
        expected (2171)

Backpatched to 7.4.X too.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/port/fseeko.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/port/fseeko.c,v
retrieving revision 1.13
diff -c -c -r1.13 fseeko.c
*** src/port/fseeko.c   29 Nov 2003 19:52:13 -0000      1.13
--- src/port/fseeko.c   23 Mar 2004 05:24:52 -0000
***************
*** 68,73 ****
--- 68,74 ----
  #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;
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to