Re: DeviceKit and /usr
Josselin Mouette <firstname.lastname@example.org> writes:
> Le mardi 08 septembre 2009 à 13:00 +0200, Bjørn Mork a écrit :
>> Trusting a library to do all your error handling and cleanup is not
>> good style IMHO. In addition to the lack of self-documenting source,
>> it often leave you with the meaningless generic error messages some
>> OSes are so full of. Applications doing their own error handling are
>> in a much better position to provide specific meaningfull error
>> messages to the user.
> If a memory allocation failed while you were manipulating strings (an
> operation with very low requirements), you are not likely to obtain
> enough memory to even display an error message.
I'm with Josselin on this. The daemons I write die when they run out of
memory for things like string manipulation. The library that I use for
such error handling supports a termination routine that can be called in
that case to do an emergency shutdown of resources, but the daemon still
Libraries are another matter, of course, and should instead return failure
codes to the calling application for the application to deal with as it
choses. But applications should feel free to terminate when they can't
even allocate small amounts of memory for string manipulation.
Russ Allbery (email@example.com) <http://www.eyrie.org/~eagle/>