[pacman-dev] [7] remove exit() calls from libalpm

Aurelien Foret aurelien at archlinux.org
Mon Feb 20 15:42:45 EST 2006


VMiklos wrote:
> On Sat, Feb 11, 2006 at 07:44:00PM +0100, Aurelien Foret <aurelien at archlinux.org> wrote:
>> For instance, you chose to set pm_errno in db_open and pkg_new, but the 
>> pm_errno value can be overwritten.
>> See code chunks where pkg_new is called: in case of a failure, pm_errno 
>> is set afterwards, meaning that the pm_errno value set in pkg_new is lost.
> 
> i think this is the right way, the "failed to prepare the transaction"
> error message is more infomative as the "memory error" one for a
> frontend. or don't you think so?

Agreed. Patch applied.

>> It may or may not be more interesting to set pm_errno in the offending 
>> function, or upon return of the function.
>> It depends on what is more meaningful from the frontend point of view...
> 
> i would say set pm_errno to PM_ERR_MEMORY, and if it's overwritten, then
> it's not a problem, any error message other than PM_ERR_MEMORY is more
> informative to the fronend. that's what my patch does.

To go even further, we should maybe add a LOG_ERROR logs mentioning the 
issue? That would give some clues even it pm_errno got overwritten...
-- 
Aurelien




More information about the pacman-dev mailing list