mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-16 07:21:57 +03:00
* libio/fileops.c (_IO_file_seekoff_mmap): When just examining the
position, calculate it to take into account an active pushback buffer. * libio/Makefile (tests): Add bug-ungetc. * libio/bug-ungetc.c: New file.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2002-07-24 Roland McGrath <roland@frob.com>
|
||||||
|
|
||||||
|
* libio/fileops.c (_IO_file_seekoff_mmap): When just examining the
|
||||||
|
position, calculate it to take into account an active pushback buffer.
|
||||||
|
|
||||||
|
* libio/Makefile (tests): Add bug-ungetc.
|
||||||
|
* libio/bug-ungetc.c: New file.
|
||||||
|
|
||||||
2002-07-23 Ulrich Drepper <drepper@redhat.com>
|
2002-07-23 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* sysdeps/generic/libc-tls.c: New file.
|
* sysdeps/generic/libc-tls.c: New file.
|
||||||
|
@ -922,8 +922,12 @@ _IO_file_seekoff_mmap (fp, offset, dir, mode)
|
|||||||
{
|
{
|
||||||
_IO_off64_t result;
|
_IO_off64_t result;
|
||||||
|
|
||||||
|
/* If we are only interested in the current position, calculate it and
|
||||||
|
return right now. This calculation does the right thing when we are
|
||||||
|
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)
|
if (mode == 0)
|
||||||
dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */
|
return fp->_offset - (fp->_IO_read_end - fp->_IO_read_ptr);
|
||||||
|
|
||||||
switch (dir)
|
switch (dir)
|
||||||
{
|
{
|
||||||
@ -943,10 +947,6 @@ _IO_file_seekoff_mmap (fp, offset, dir, mode)
|
|||||||
/* No negative offsets are valid. */
|
/* No negative offsets are valid. */
|
||||||
return EOF;
|
return EOF;
|
||||||
|
|
||||||
/* If we are only interested in the current position we've found it now. */
|
|
||||||
if (mode == 0)
|
|
||||||
return offset;
|
|
||||||
|
|
||||||
result = _IO_SYSSEEK (fp, offset, 0);
|
result = _IO_SYSSEEK (fp, offset, 0);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return EOF;
|
return EOF;
|
||||||
|
Reference in New Issue
Block a user