On Wed 20 Feb 2013 20:02, Eli Zaretskii <e...@gnu.org> writes: > Btw, it might be a good idea to provide some application-level > diagnostics in this specific case, since "No error", which corresponds > to errno = 0, is not very useful.
I pushed this: 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; if (errno) SCM_SYSERROR; scm_misc_error (FUNC_NAME, "file truncated while reading", SCM_EOL); } Should be OK, no? Andy -- http://wingolog.org/