projects
/
external
/
glibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
936668d
)
(_IO_new_file_seekoff): If mode is 0 and fp->_offset == _IO_pos_BAD, just call _IO_SY...
author
Ulrich Drepper
<drepper@redhat.com>
Tue, 9 Nov 2004 07:04:08 +0000
(07:04 +0000)
committer
Ulrich Drepper
<drepper@redhat.com>
Tue, 9 Nov 2004 07:04:08 +0000
(07:04 +0000)
libio/fileops.c
patch
|
blob
|
history
diff --git
a/libio/fileops.c
b/libio/fileops.c
index
08eff0a
..
2d787d2
100644
(file)
--- a/
libio/fileops.c
+++ b/
libio/fileops.c
@@
-989,7
+989,18
@@
_IO_new_file_seekoff (fp, offset, dir, mode)
/* Adjust for read-ahead (bytes is buffer). */
offset -= fp->_IO_read_end - fp->_IO_read_ptr;
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(). */
offset += fp->_offset;
if (offset < 0)