summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-08-31 13:14:49 +0000
committerache <ache@FreeBSD.org>2001-08-31 13:14:49 +0000
commit8479e8b5bbb367ddb00a526c5b6dac92b6de983e (patch)
tree5b8357b8ac1831050c1f98b1c201cd65a2213bb8 /lib
parentae7b8fc7f6b359ec0633a545f7f08668243d2336 (diff)
downloadFreeBSD-src-8479e8b5bbb367ddb00a526c5b6dac92b6de983e.zip
FreeBSD-src-8479e8b5bbb367ddb00a526c5b6dac92b6de983e.tar.gz
Initialize _offset to 0 in fopen(), it helps to optimize fseek/ftell
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdio/fopen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/stdio/fopen.c b/lib/libc/stdio/fopen.c
index aca314c..f09fe8a 100644
--- a/lib/libc/stdio/fopen.c
+++ b/lib/libc/stdio/fopen.c
@@ -69,6 +69,8 @@ fopen(file, mode)
}
fp->_file = f;
fp->_flags = flags;
+ fp->_flags |= __SOFF;
+ fp->_offset = 0;
fp->_cookie = fp;
fp->_read = __sread;
fp->_write = __swrite;
OpenPOWER on IntegriCloud