OSDN Git Service
(root)
/
uclinux-h8
/
uclibc-ng.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cfcc4f
)
Fix fseek behavior.
author
Manuel Novoa III
<mjn3@codepoet.org>
Tue, 25 Sep 2001 19:39:46 +0000
(19:39 -0000)
committer
Manuel Novoa III
<mjn3@codepoet.org>
Tue, 25 Sep 2001 19:39:46 +0000
(19:39 -0000)
libc/stdio/stdio.c
patch
|
blob
|
history
diff --git
a/libc/stdio/stdio.c
b/libc/stdio/stdio.c
index
01588aa
..
e67408d
100644
(file)
--- a/
libc/stdio/stdio.c
+++ b/
libc/stdio/stdio.c
@@
-588,15
+588,16
@@
int fseek(FILE *fp, long int offset, int ref)
--offset; /* adjust offset (clear flag below). */
}
}
- fp->bufpos = fp->bufread = fp->bufstart;
}
if ((fp->mode & __MODE_ERR) ||
(((ref != SEEK_CUR) || offset) && (lseek(fp->fd, offset, ref) < 0))) {
- fp->mode |= __MODE_ERR; /* Possibly redundant, but doesn't hurt. */
return -1;
}
+ if (READING(fp)) {
+ fp->bufpos = fp->bufread = fp->bufstart;
+ }
fp->mode &= ~(__MODE_EOF | __MODE_UNGOT);
return 0;