MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_log_set_crash_durable

Function cbm_log_set_crash_durable

src/foundation/log.c:39–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37static _Atomic bool g_log_crash_durable = false;
38
39void cbm_log_set_crash_durable(bool enabled) {
40 if (enabled) {
41 /* Best effort by contract: setvbuf is only guaranteed before a stream's
42 * first operation, so a process that has already written to stderr
43 * keeps its buffering. The per-line flush in emit_line is what makes
44 * the durability guarantee hold either way. */
45 (void)setvbuf(stderr, NULL, _IONBF, 0);
46 }
47 atomic_store_explicit(&g_log_crash_durable, enabled, memory_order_relaxed);
48}
49
50bool cbm_log_crash_durable(void) {
51 return atomic_load_explicit(&g_log_crash_durable, memory_order_relaxed);

Callers 2

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected