svn commit: r246120 - in head: include lib/libc/stdio tools/regression/lib/libc/stdio

John Baldwin jhb at freebsd.org
Thu Jan 31 20:01:46 UTC 2013


On Thursday, January 31, 2013 11:23:08 am John Baldwin wrote:
> On Wednesday, January 30, 2013 9:59:26 am Pietro Cerutti wrote:
> > +static fpos_t
> > +fmemopen_seek (void *cookie, fpos_t offset, int whence)
> > +{
> > +	struct __fmemopen_cookie *ck = cookie;
> > +
> > +
> > +	switch (whence) {
> > +	case SEEK_SET:
> > +		if (offset > ck->len) {
> > +			errno = EINVAL;
> > +			return (-1);
> 
> This should return POS_ERR on failure.

I'm wrong on this one.  POS_ERR is internal to fseek.c and the funopen()
manpage is clear that -1 should be returned in this case.

-- 
John Baldwin


More information about the svn-src-all mailing list