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

Function watcher_git_output_create

src/watcher/watcher.c:174–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174static bool watcher_git_output_create(watcher_git_output_t *output) {
175 if (!output) {
176 return false;
177 }
178 memset(output, 0, sizeof(*output));
179 int written =
180 snprintf(output->path, sizeof(output->path), "%s/cbm-watcher-git-XXXXXX", cbm_tmpdir());
181 if (written <= 0 || written >= (int)sizeof(output->path)) {
182 output->path[0] = '\0';
183 return false;
184 }
185 int descriptor = cbm_mkstemp(output->path);
186 if (descriptor < 0) {
187 output->path[0] = '\0';
188 return false;
189 }
190#ifdef _WIN32
191 bool closed = _close(descriptor) == 0;
192#else
193 bool closed = close(descriptor) == 0;
194#endif
195 if (!closed) {
196 watcher_git_output_cleanup(output);
197 }
198 return closed;
199}
200
201#ifdef _WIN32
202/* 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