gpg_err_code_from_errno usage

Nikos Mavrogiannopoulos nmav at gnutls.org
Mon Mar 13 13:54:48 CET 2006


On 3/11/06, Werner Koch <wk at gnupg.org> wrote:

> > Maybe but this doesn't change my argument. It is less portable than
> > the ISO/ANSI C  behavior. Given that libgcrypt is already ported to
> > non-UNIX systems as well[0], I would consider this a bug.
> To protect against ill behaving implementaions we even use some
> failsafe code in the internal malloc code:

Ok, thanks, then my concern of this behaviour not working is addressed. A
small bug in the code is that errno is not set to zero before
thus if a system does not set errno, and errno (most likely)
contains some previous value that value will be detected.

In any case I don't find any benefit into checking errno for memory
allocation. The value is not interesting at all, and it adds
complexity to the code.


Nikos



More information about the Gcrypt-devel mailing list