mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 16:21:06 +00:00
(_IO_new_file_seekoff): If mode is 0 and fp->_offset == _IO_pos_BAD, just call _IO_SYSSEEK (fp, 0, dir) and if successful set fp->_offset.
This commit is contained in:
parent
936668d369
commit
eca29725d1
@ -989,7 +989,18 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
|
|||||||
/* Adjust for read-ahead (bytes is buffer). */
|
/* Adjust for read-ahead (bytes is buffer). */
|
||||||
offset -= fp->_IO_read_end - fp->_IO_read_ptr;
|
offset -= fp->_IO_read_end - fp->_IO_read_ptr;
|
||||||
if (fp->_offset == _IO_pos_BAD)
|
if (fp->_offset == _IO_pos_BAD)
|
||||||
goto dumb;
|
{
|
||||||
|
if (mode != 0)
|
||||||
|
goto dumb;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = _IO_SYSSEEK (fp, 0, dir);
|
||||||
|
if (result == EOF)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
fp->_offset = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* Make offset absolute, assuming current pointer is file_ptr(). */
|
/* Make offset absolute, assuming current pointer is file_ptr(). */
|
||||||
offset += fp->_offset;
|
offset += fp->_offset;
|
||||||
if (offset < 0)
|
if (offset < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user