Skip to content

Commit

Permalink
* libio/fileops.c (_IO_file_seekoff_mmap): Don't rely on FP->_offset,
Browse files Browse the repository at this point in the history
	which gets moved around.  Calculate size of mmap'd buffer instead.
  • Loading branch information
Roland McGrath committed Jul 24, 2002
1 parent bb0ec5b commit 11d657d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2002-07-24 Roland McGrath <roland@frob.com>

* libio/fileops.c (_IO_file_seekoff_mmap): Don't rely on FP->_offset,
which gets moved around. Calculate size of mmap'd buffer instead.

2002-07-24 Philip Blundell <philb@gnu.org>

* sysdeps/unix/arm/brk.S: Improve schedule.
Expand Down
3 changes: 2 additions & 1 deletion libio/fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,8 @@ _IO_file_seekoff_mmap (fp, offset, dir, mode)
using a pushback buffer, but in the usual case has the same value as
(fp->_IO_read_ptr - fp->_IO_buf_base). */
if (mode == 0)
return fp->_offset - (fp->_IO_read_end - fp->_IO_read_ptr);
return ((fp->_IO_buf_end - fp->_IO_buf_base)
- (fp->_IO_read_end - fp->_IO_read_ptr));

switch (dir)
{
Expand Down

0 comments on commit 11d657d

Please sign in to comment.