fatal-signal: Initialize library upon any call to public function.
authorBen Pfaff <blp@nicira.com>
Tue, 23 Mar 2010 22:27:44 +0000 (15:27 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 24 Mar 2010 23:52:07 +0000 (16:52 -0700)
commitc874f17fc743b38295f6059ab6554561b7555724
tree5f64a680d4ae6adf8ab30197cacd0e929c6b7eee
parent271915d3877ab9d74836a986cb2eb483071f048b
fatal-signal: Initialize library upon any call to public function.

Not calling fatal_signal_init() means that the signal handlers don't get
registered, so the process won't clean up on fatal signals.  Furthermore,
signal_fds[0] is then 0, which means that fatal-signal_wait() waits on
stdin, so if you are testing a program interactively and accidentally type
something on stdin then that program's CPU usage jumps to 100%.

Since poll_block() calls fatal_signal_wait() this seems like the most
reliable solution.
lib/fatal-signal.c