cashew: use g_unix_signal_add to catch signals 64 bit safe

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: Ic7dec46e5069a95905bb2a5c6beccb5359d1ed28
Reviewed-on: https://gerrit.chromium.org/gerrit/13772
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
1 file changed