List Info

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




Re: Is invoking exit(2) in a library the right thing to do?
user name
2007-11-05 08:54:46
On Mon,  5 Nov 2007 13:37, mdLinux.IT said:

> I still do not consider calling exit(2) in a library
acceptable under
> any condition.

So you want abort () instead?  I consider this a bad option
in this case
because exit handlers would not be run.

Given the reluctance of many programmers to properly check
error codes
and act accordingly, there is no choice in critical
situation than to
terminate the process.  It was a design decision of the
linux kernel to
always provide a /dev/random and it is a design decision of
libgcrypt
not to return bad random number - in any case.

BTW, glibc also calls abort if it detects an internal
inconsistency.


Salam-Shalom,

   Werner


-- 
Die Gedanken sind frei.  Auschnahme regelt ein
Bundeschgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-develgnupg.org

http://lists.gnupg.org/mailman/listinfo/gcrypt-devel

Re: Is invoking exit(2) in a library the right thing to do?
user name
2007-11-05 09:00:22
On Nov 05, Werner Koch <wkgnupg.org> wrote:

> > I still do not consider calling exit(2) in a
library acceptable under
> > any condition.
> So you want abort () instead?  I consider this a bad
option in this case
> because exit handlers would not be run.
I the function to fail with something like an error code.

> Given the reluctance of many programmers to properly
check error codes
> and act accordingly, there is no choice in critical
situation than to
> terminate the process.
I still disagree.

-- 
ciao,
Marco

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-develgnupg.org

http://lists.gnupg.org/mailman/listinfo/gcrypt-devel

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )