From a0ba17755ec9b668e1bf97c92ebe24e61df3874a Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 31 Aug 2001 13:14:49 +0000 Subject: [PATCH] Initialize _offset to 0 in fopen(), it helps to optimize fseek/ftell --- lib/libc/stdio/fopen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libc/stdio/fopen.c b/lib/libc/stdio/fopen.c index aca314ced4dc..f09fe8a6e552 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;