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

Function diag_tmp_base

src/foundation/diagnostics.c:249–261  ·  view source on GitHub ↗

Diagnostics placement honors the documented contract ($TMPDIR, /tmp * fallback) without touching cbm_tmpdir(), whose many other callers keep * their established behavior. Windows already resolves the real user temp. */

Source from the content-addressed store, hash-verified

247 * fallback) without touching cbm_tmpdir(), whose many other callers keep
248 * their established behavior. Windows already resolves the real user temp. */
249static const char *diag_tmp_base(char *buffer, size_t size) {
250#ifdef _WIN32
251 (void)buffer;
252 (void)size;
253 return cbm_tmpdir();
254#else
255 cbm_safe_getenv("TMPDIR", buffer, size, NULL);
256 if (buffer[0] != '\0') {
257 return buffer;
258 }
259 return "/tmp";
260#endif
261}
262
263static bool diag_directory_prepare(void) {
264 char tmp_base[CBM_PATH_MAX];

Callers 1

diag_directory_prepareFunction · 0.85

Calls 2

cbm_tmpdirFunction · 0.85
cbm_safe_getenvFunction · 0.85

Tested by

no test coverage detected