bug-gnulib
[Top][All Lists]
Advanced

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

Re: full_read depends on incoming errno


From: Paolo Bonzini
Subject: Re: full_read depends on incoming errno
Date: Thu, 21 Feb 2013 17:29:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

Il 20/02/2013 20:58, Andy Wingo ha scritto:
> 
>     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);
>       }

Doesn't it need to set errno to zero before calling full_read?

Paolo



reply via email to

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