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

Function private_runtime_open

src/daemon/ipc.c:696–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694static int private_directory_tree_open(const char *directory_path);
695
696static bool private_runtime_open(const char *path, int *fd_out, dev_t *device_out,
697 ino_t *inode_out) {
698 if (!path || !fd_out || !device_out || !inode_out) {
699 return false;
700 }
701
702 int fd = private_directory_tree_open(path);
703 if (fd < 0) {
704 return false;
705 }
706
707 struct stat before;
708 bool secured = private_runtime_snapshot(fd, path, true, &before);
709 if (!secured) {
710 (void)close(fd);
711 return false;
712 }
713 *fd_out = fd;
714 *device_out = before.st_dev;
715 *inode_out = before.st_ino;
716 return true;
717}
718
719static bool endpoint_runtime_still_valid(const cbm_daemon_ipc_endpoint_t *endpoint) {
720 if (!endpoint || endpoint->dir_fd < 0) {

Callers 1

Calls 2

private_runtime_snapshotFunction · 0.85

Tested by

no test coverage detected