Is invoking exit(2) in a library the right thing to do?

Moritz Schulte Moritz.Schulte at ruhr-uni-bochum.de
Sat Mar 3 11:22:05 CET 2007


> currently log_fatal() ends up invoking exit(2). Is this really the
> right thing to do? It does not give applications using libgcrypt any
> chance to sanely handle fatal errors afaiui, for example by falling
> back on non-tls mode.

Hmm.  The reason for exit is probably that log_fatal should be NEVER
called unless something is REALLY fucked up.  Especially in crypto
applications it might be the best thing to do, since a serious bug in
the library (or in the program) should not treated like "oh, well, that
crypto feature is currently not available", but rather like "STOP!".

My guess.

Moritz





More information about the Gcrypt-devel mailing list