#include <hallo.h>
* Jiří Paleček [Mon, Mar 17 2008, 12:28:43AM]:
> On Sun, 16 Mar 2008 22:39:55 +0100, Eduard Bloch <[EMAIL PROTECTED]> wrote:
>
>> #include <hallo.h>
>> * Jiří Paleček [Sun, Mar 16 2008, 09:10:20PM]:
>>> tags 471110 +patch
>>> thanks
>>>
>>> Hello,
>>>
>>> I have found out this problem was due to bad handling of EINTR and  
>>> EAGAIN
>>> error values. The attached patch fixes it.
>>
>> Hello,
>>
>> thanks for the problem identification. On the first glance your patch
>> breaks the semantics of acbuf members for weak reasons, and I don't like
>
> I changed the semantics of acbuf members because it was broken in the  
> first place. For example, look at the return value of read:
>
> +-----+---------------------+
> |> 0  | success, ret=number |
> |     | of bytes            |
> +-----+---------------------+
> |= 0  | end of              |
> |     | transfer            |
> +-----+---------------------+
> |< 0  | fatal error,        |
> |     | transfer aborted    |
> +-----+---------------------+
>
> There is simply not a place for benign errors which indicate the request  
> failed but retries will be possible and eventually succeed. I changed it  

Ok, on the second look you are right, less or more. Initialy this
class should abstract away some handling of asynchronous IO operation
but the pseudo-spec did not cover EINTR... and it cannot be handled like
EAGAIN there because the caller might have other assumption. Rereading
errno in the caller is possible but is kinda absurd under mentioned
terms.

> only so that the negative return value indicates the error code (by  
> returning Exxxx as -Exxxx), so the caller can check and distinguish fatal 

Sure, sure, the old negative-errno-as-return-code trick, used with fuse
and others.

> conditions from benign ones. You could read errno in the caller, but that 
> is, I think, more fragile. You could also throw an exception, which would 
> be a superior solution, but you don't seem to use exceptions in the code, 
> so that's up to you.

Yes, in acng the use of exceptions and RTTI is minimized and can be
disabled if possible/required.

Ok, thanks, fixes will be integrated RSN.

Eduard.
-- 
Nichts ist besser verteilt als die Intelligenz - wir alle sind mit der
eigenen zufrieden.
                -- Spanisches Sprichwort


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to