cashew: use g_unix_signal_add to catch signals

Register a GSourceCallbackFunc to handle signals so that we do not log
in the signal handler itself.  Logging in the actual signal handler
can causes crashes.

BUG=chromium-os:24749
TEST=run cashew, restart it.  Make sure that it exists cleanly without a core.

Change-Id: I3e9d4fb046951a9c2445b9f2ebbd601065f21960
Reviewed-on: https://gerrit.chromium.org/gerrit/13738
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
1 file changed