http://bugzilla.novell.com/show_bug.cgi?id=599698
http://bugzilla.novell.com/show_bug.cgi?id=599698#c8
--- Comment #8 from Jon Nelson 2010-05-20 13:33:31 UTC ---
1. never call exit from a signal handler. exit is *not* the same as _exit
2. functions registered with atexit are not called if the program exits
/abnormally/ due to a signal (or _exit, or abort, and so on)
3. using a global variable, and setting it in the signal handler, the "main
loop" would then be responsible for calling exit. functions registered with
atexit would then execute.
You could always use longjmp but that method has even more subtle issues.
There might be other ways to handle this but the only "safe" ways I know of
involve setting a global (preferably one of type atomic_t) and checking the
value of that variable at various points within the flow of the program.
Hope this is helpful.
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.