mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Fix BSD fseeko to seek from the end of the file.
This commit is contained in:
parent
8e9c52e427
commit
9e4a2de844
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/port/fseeko.c,v 1.18 2005/07/28 04:03:14 tgl Exp $
|
* $PostgreSQL: pgsql/src/port/fseeko.c,v 1.19 2005/08/11 23:05:14 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -70,6 +70,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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user