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

Function private_runtime_open

src/daemon/ipc.c:703–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 2

private_runtime_snapshotFunction · 0.85

Tested by

no test coverage detected