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

Function watcher_git_output_create

src/watcher/watcher.c:179–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179static bool watcher_git_output_create(watcher_git_output_t *output) {
180 if (!output) {
181 return false;
182 }
183 memset(output, 0, sizeof(*output));
184 int written =
185 snprintf(output->path, sizeof(output->path), "%s/cbm-watcher-git-XXXXXX", cbm_tmpdir());
186 if (written <= 0 || written >= (int)sizeof(output->path)) {
187 output->path[0] = '\0';
188 return false;
189 }
190 int descriptor = cbm_mkstemp(output->path);
191 if (descriptor < 0) {
192 output->path[0] = '\0';
193 return false;
194 }
195#ifdef _WIN32
196 bool closed = _close(descriptor) == 0;
197#else
198 bool closed = close(descriptor) == 0;
199#endif
200 if (!closed) {
201 watcher_git_output_cleanup(output);
202 }
203 return closed;
204}
205
206#ifdef _WIN32
207/* CreateProcessW does not search PATH when lpApplicationName is non-NULL.

Callers 1

watcher_git_runFunction · 0.85

Calls 3

cbm_tmpdirFunction · 0.85
cbm_mkstempFunction · 0.85

Tested by

no test coverage detected