bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Tar short read


From: Sergey Poznyakoff
Subject: Re: [Bug-tar] Tar short read
Date: Tue, 27 Sep 2011 22:48:05 +0300

Kevin Fox <address@hidden> ha escrit:

> Thats not how I read that function:
> size_t safe_rw (int fd, void const *buf, size_t count)
> {
>   enum { BUGGY_READ_MAXIMUM = INT_MAX & ~8191 };
>   for (;;)
>     {
>       ssize_t result = rw (fd, buf, count);
>       if (0 <= result)
>         return result;
>
> short read, return right away without looping. I don't believe tar

You seem to confuse "short reads" with "interrupted reads".  A "short
read" is when read returns less bytes than requested.  No signals are
delivered it this case.  An "interrupted read" occurs when a signal is
delivered while read is in progress.  In that case read returns -1 and
sets errno to EINTR.  That's exactly what this function is designed to
handle.

Regards,
Sergey



reply via email to

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