MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / fault_handler

Function fault_handler

main.cpp:63–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61#ifndef _WIN32
62
63void fault_handler(int sig) {
64 void *array[30];
65 size_t size;
66
67 // get void*'s for all entries on the stack
68 size = backtrace(array, 30);
69
70 // print out all the frames to stderr
71 fprintf(stderr, "Error: signal %d:\n", sig);
72 backtrace_symbols_fd(array, size, 2);
73 if (w!=NULL) {
74 fprintf(stderr, "Forcing save\n");
75 w->saveState();
76 }
77 exit(1);
78}
79
80
81

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected