Signal handlers only publish intent and close stdin. The daemon host observes * the atomic; an MCP thin client unblocks its reader and closes its authenticated * daemon connection from normal thread context. */
| 405 | * the atomic; an MCP thin client unblocks its reader and closes its authenticated |
| 406 | * daemon connection from normal thread context. */ |
| 407 | static void request_shutdown(void) { |
| 408 | if (atomic_exchange(&g_shutdown, 1)) { |
| 409 | return; /* already shutting down */ |
| 410 | } |
| 411 | #ifdef _WIN32 |
| 412 | (void)_close(_fileno(stdin)); |
| 413 | #else |
| 414 | (void)close(STDIN_FILENO); |
| 415 | #endif |
| 416 | } |
| 417 | |
| 418 | static void signal_handler(int sig) { |
| 419 | (void)sig; |
no test coverage detected