A patch for _IO_old_file_seekoff
H.J. Lu
hjl@lucon.org
Mon Oct 26 08:09:00 GMT 1998
This will bring _IO_old_file_seekoff in sync with _IO_new_file_seekoff.
Will that be a problem?
Thanks.
--
H.J. Lu (hjl@gnu.org)
---
Mon Oct 26 07:46:36 1998 H.J. Lu <hjl@gnu.org>
* libio/oldfileops.c (_IO_old_file_seekoff): Just return the
offset if mode == 0.
Index: libio/oldfileops.c
===================================================================
RCS file: /home/work/cvs/gnu/glibc/libio/oldfileops.c,v
retrieving revision 1.1.1.10
diff -u -p -r1.1.1.10 oldfileops.c
--- oldfileops.c 1998/10/26 15:29:41 1.1.1.10
+++ oldfileops.c 1998/10/26 15:45:18
@@ -496,6 +496,10 @@ _IO_old_file_seekoff (fp, offset, dir, m
}
/* At this point, dir==_IO_seek_set. */
+ /* If we are only interested in the current position we've found it now. */
+ if (mode == 0)
+ return offset;
+
/* If destination is within current buffer, optimize: */
if (fp->_old_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
&& !_IO_in_backup (fp))
More information about the Libc-hacker
mailing list