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

Function tf_setup_cache_sentinel

tests/test_main.c:200–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198};
199
200static bool tf_setup_cache_sentinel(void) {
201 snprintf(tf_home_sentinel, sizeof(tf_home_sentinel), "/tmp/cbm-test-home-XXXXXX");
202 if (!cbm_mkdtemp(tf_home_sentinel)) {
203 return false;
204 }
205 /* Legacy integration fixtures derive DB paths from HOME, while production
206 * cache_dir() prefers CBM_CACHE_DIR. A private HOME plus no inherited cache
207 * override keeps both conventions pointed at the same isolated tree. */
208 cbm_setenv("HOME", tf_home_sentinel, 1);
209 cbm_unsetenv("CBM_CACHE_DIR");
210 for (size_t i = 0U; i < sizeof(tf_client_home_overrides) / sizeof(tf_client_home_overrides[0]);
211 i++) {
212 cbm_unsetenv(tf_client_home_overrides[i]);
213 }
214 atexit(tf_cleanup_cache_sentinel);
215 return true;
216}
217
218/* Fast real-process probes for the async index-supervisor contract. They run
219 * only in a child admitted by the exact build-bound worker grammar. */

Callers 1

mainFunction · 0.85

Calls 3

cbm_mkdtempFunction · 0.85
cbm_setenvFunction · 0.85
cbm_unsetenvFunction · 0.85

Tested by

no test coverage detected