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

Function root_status

src/watcher/watcher.c:988–1000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

986} root_status_t;
987
988static root_status_t root_status(const char *root_path, int *out_errno) {
989 *out_errno = 0;
990 if (!root_path) {
991 return ROOT_UNCERTAIN;
992 }
993 struct stat st;
994 if (stat(root_path, &st) == 0) {
995 /* Exists but is no longer a directory → the root directory is gone. */
996 return S_ISDIR(st.st_mode) ? ROOT_PRESENT : ROOT_MISSING;
997 }
998 *out_errno = errno;
999 return cbm_watcher_root_missing_errno(errno) ? ROOT_MISSING : ROOT_UNCERTAIN;
1000}
1001
1002/* Sustained-absence window (seconds) before a missing root may be pruned.
1003 * Generous default: 10 minutes. Override with CBM_WATCHER_PRUNE_GRACE_S

Callers 2

prune_missing_projectFunction · 0.85
poll_projectFunction · 0.85

Calls 2

statClass · 0.70

Tested by

no test coverage detected