Fix signal handler
Brought to you by:
robodan
The function "exit()" does not belong to the list of async-signal-safe functions.
See section "2.4.3 Signal Actions" from the document "2.4 Signal Concepts".
http://opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03
http://opengroup.org/onlinepubs/009695399/functions/_Exit.html
Should this call be replaced by a safe alternative in your function "hupHandler"?
http://mstone.svn.sourceforge.net/viewvc/mstone/trunk/mstone/src/sysdep.c?revision=7&view=markup
Logged In: YES
user_id=865423
Originator: NO
This could only be a problem if a protocol registers an atexit callback (none do this currently), and signals arrive too fast for the process to finish exiting. Our current signaling code leaves more than a second between signal attempts.
This has never shown up as a problem in practice (give me an example if you've seen it).
I'm going to leave the code as-is.
Logged In: YES
user_id=572001
Originator: YES
I suggest to develop POSIX compliant source code. Would you like to avoid undefined behaviour?
Logged In: YES
user_id=865423
Originator: NO
I can't look into this bug without information on how to reproduce it.
Logged In: YES
user_id=572001
Originator: YES
The mistake is that the function "exit()" is called by a signal handler at the moment. "_Exit()" must be used instead.