On 02/19/13 13:15, Eli Zaretskii wrote:
> if (full_read (fd, cookie, sizeof cookie) != sizeof cookie
> || full_read (fd, SCM_BYTEVECTOR_CONTENTS (bv),
> SCM_BYTEVECTOR_LENGTH (bv)) != SCM_BYTEVECTOR_LENGTH (bv))
> {
> int errno_save = errno;
> (void) close (fd);
> errno = errno_save;
> SCM_SYSERROR;
> }
>
...
> If the file is too short for these two reads, then errno will have
> some random value (because full_read "succeeded" as far as that
> function is concerned), and the error message in SCM_SYSERROR will
> display something utterly unrelated
Yes, full_read should return a short value and set errno to 0,
so errno_save should be zero. If SCM_SYSERROR displays
a seemingly-unrelated diagnostic like "Error 0", that would
explain the problem.
> I think it's a Guile
> problem, since from gnulib POV, nothing went wrong in that call.
Yes, that sounds right.