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

Function cli_uninstall_restore_stream

tests/test_cli.c:3541–3555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3539}
3540
3541static bool cli_uninstall_restore_stream(FILE *stream, int saved) {
3542 if (saved < 0) {
3543 return false;
3544 }
3545 bool flushed = stream == stdin || fflush(stream) == 0;
3546#ifdef _WIN32
3547 bool restored = _dup2(saved, _fileno(stream)) == 0;
3548 _close(saved);
3549#else
3550 bool restored = dup2(saved, fileno(stream)) >= 0;
3551 close(saved);
3552#endif
3553 clearerr(stream);
3554 return flushed && restored;
3555}
3556
3557static bool cli_uninstall_capture_text(FILE *file, char *out, size_t capacity) {
3558 if (fseek(file, 0, SEEK_SET) != 0) {

Callers 1

test_cli.cFile · 0.85

Calls 1

closeFunction · 0.50

Tested by

no test coverage detected