[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Optimistic error handling in lwIP
From: |
Kieran Mansley |
Subject: |
Re: [lwip-users] Optimistic error handling in lwIP |
Date: |
Thu, 27 Feb 2003 13:51:57 +0000 (GMT) |
In general I agree that returning error codes from functions is a good
idea (and I much prefer having an non-void function or error code
argument rather than using the errno variable).
However, I'm not sure if I've missed the point of your mbox_fetch
example. If it gets interrupted, should sys_arch_mbox_fetch not just try
again? If we checked the result of sys_mbox_fetch to check if it was
NULL, all it would do as a result is call sys_mbox_fetch again and hope it
succeeded the second time. Therefore, why not keep the majority of code
simple and check for a NULL return in sys_arch_mbox_fetch, and only return
when you have something? It seems to me that the assumption the lwip code
is making (that sys_mbox_fetch only returns when it has a message) is
valid, or at least *should* be valid if the sys_arch has been properly
implemented.
Kieran