bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: seekable stdin test failure on OS X


From: Paul Eggert
Subject: Re: seekable stdin test failure on OS X
Date: Mon, 09 Apr 2007 10:51:28 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Eric Blake <address@hidden> writes:

> +#elif HAVE___FPURGE
> +  /* __fpurge has no return value, so we must check errno.  */
> +  errno = 0;
> +  __fpurge (stream);
> +  if (errno)
> +    result = EOF;
> +  else
> +    {
> +      result = 0;
> +      errno = e1;
> +    }

This doesn't look right.  __fpurge is not documented to set errno
on Solaris, and I suspect it sets errno to garbage.  I would just
call __fpurge and ignore errno here.

> +    /* Set position of underlying fd first; hopefully we don't confuse
> +       the stdio routines.  */
> +    else if (lseek (fileno (stream), position, SEEK_SET) != position
> +          || fseeko (stream, position, SEEK_SET) != 0)

I don't get the logic here.  Why call both lseek and fseeko?
Won't fseeko suffice?  I think the lseek might cause problems.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]