Ctrl+C handling for Windows console apps
| 111 | |
| 112 | // Ctrl+C handling for Windows console apps |
| 113 | static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) { |
| 114 | if (is_tracing && fdwCtrlType == CTRL_C_EVENT) { |
| 115 | printf("Ctrl-C detected! Flushing trace and shutting down.\n\n"); |
| 116 | mtr_flush(); |
| 117 | mtr_shutdown(); |
| 118 | } |
| 119 | ExitProcess(1); |
| 120 | } |
| 121 | |
| 122 | void mtr_register_sigint_handler() { |
| 123 | // For console apps: |
nothing calls this directly
no test coverage detected