1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Backpatch fseeko fix for seeking from end of file.

This commit is contained in:
Bruce Momjian
2005-08-12 00:29:22 +00:00
parent 18e615979e
commit 66c2f44b85

View File

@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/port/fseeko.c,v 1.17 2004/12/31 22:03:53 pgsql Exp $ * $PostgreSQL: pgsql/src/port/fseeko.c,v 1.17.4.1 2005/08/12 00:29:22 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@@ -72,6 +72,7 @@ fseeko(FILE *stream, off_t offset, int whence)
if (fstat(fileno(stream), &filestat) != 0) if (fstat(fileno(stream), &filestat) != 0)
goto failure; goto failure;
floc = filestat.st_size; floc = filestat.st_size;
floc += offset;
if (fsetpos(stream, &floc) != 0) if (fsetpos(stream, &floc) != 0)
goto failure; goto failure;
#ifdef bsdi #ifdef bsdi