Open sean-gilliam opened 7 months ago
Since Riftshadow has several threads / connections open, we should consider capturing at least the following signals using signal or sigaction.
signal
sigaction
kill -9
There may be others. These are the ones that spring to mind though. Note that sigaction is Linux-only I believe.
Example:
int main(void) { signal(SIGINT, sigIntHandler); } void sigIntHandler(int signum) { // Some database connection cleanup exit(1); }
int main(void) { struct sigaction psa; memset (&psa, 0, sizeof (psa)); psa.sa_handler = sigIntHandler; sigaction (SIGINT, &psa, NULL); } void sigIntHandler(int signum) { // Some database connection cleanup exit(1); }
Since Riftshadow has several threads / connections open, we should consider capturing at least the following signals using
signal
orsigaction
.kill -9
and the like are usedThere may be others. These are the ones that spring to mind though. Note that
sigaction
is Linux-only I believe.Example: