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

Function watcher_git_output_create

src/watcher/watcher.c:239–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239static bool watcher_git_output_create(watcher_git_output_t *output) {
240 if (!output) {
241 return false;
242 }
243 memset(output, 0, sizeof(*output));
244 int written =
245 snprintf(output->path, sizeof(output->path), "%s/cbm-watcher-git-XXXXXX", cbm_tmpdir());
246 if (written <= 0 || written >= (int)sizeof(output->path)) {
247 output->path[0] = '\0';
248 return false;
249 }
250 int descriptor = cbm_mkstemp(output->path);
251 if (descriptor < 0) {
252 output->path[0] = '\0';
253 return false;
254 }
255#ifdef _WIN32
256 bool closed = _close(descriptor) == 0;
257#else
258 bool closed = close(descriptor) == 0;
259#endif
260 if (!closed) {
261 watcher_git_output_cleanup(output);
262 }
263 return closed;
264}
265
266#ifdef _WIN32
267/* CreateProcessW does not search PATH when lpApplicationName is non-NULL.

Callers 1

watcher_git_runFunction · 0.85

Calls 4

cbm_tmpdirFunction · 0.85
cbm_mkstempFunction · 0.85
closeFunction · 0.50

Tested by

no test coverage detected