The `signal ` argument shadows the libc function of the same name and I would perhaps change the call to sigaction() to `CHECK_EQ(sigaction(signal, &sa, NULL), 0)`.  RegisterSignalHandler() is guilty of same, though.