This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: 1.3.3-2: fseek fails on multiples of 1024 (binary mode)
- To: newlib at sources dot redhat dot com
- Subject: Re: 1.3.3-2: fseek fails on multiples of 1024 (binary mode)
- From: Christopher Faylor <cgf at redhat dot com>
- Date: Tue, 23 Oct 2001 23:23:38 -0400
- References: <20011021225629.17478.qmail@foolabs.com> <20011022150648.B10383@redhat.com> <3BD556FE.46350849@syntrex.com> <20011023141012.G31068@cygbert.vinschen.de> <3BD59914.780FD423@syntrex.com> <20011023125049.A22558@redhat.com> <3BD5F576.8FC68318@cygnus.com> <20011023230703.A26423@redhat.com>
On Tue, Oct 23, 2001 at 11:07:03PM -0400, Christopher Faylor wrote:
>Is this fixed in more recent BSD code, perhaps? Or has the code diverged too far
>for this to be useful?
Answering my own question: No, the code hasn't changed that much and
there seems to be one minor change in it, which is below.
Is it my imagination or does this actually fix the problem? I haven't
studied the code that much but, from context, the patch makes sense.
cgf
Index: libc/stdio/fseek.c
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/stdio/fseek.c,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 fseek.c
*** fseek.c 2000/02/17 19:39:47 1.1.1.1
--- fseek.c 2001/10/24 03:20:13
*************** fseek (fp, offset, whence)
*** 278,283 ****
--- 278,284 ----
if ((*seekfn) (fp->_cookie, curoff, SEEK_SET) == POS_ERR)
goto dumb;
fp->_r = 0;
+ fp->_p = fp->_bf._base;
if (HASUB (fp))
FREEUB (fp);
fp->_flags &= ~__SEOF;