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

Function private_runtime_open

src/daemon/ipc.c:875–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

873static int private_directory_tree_open(const char *directory_path);
874
875static bool private_runtime_open(const char *path, int *fd_out, dev_t *device_out,
876 ino_t *inode_out) {
877 if (!path || !fd_out || !device_out || !inode_out) {
878 return false;
879 }
880
881 int fd = private_directory_tree_open(path);
882 if (fd < 0) {
883 return false;
884 }
885
886 struct stat before;
887 bool secured = private_runtime_snapshot(fd, path, true, &before);
888 if (!secured) {
889 (void)close(fd);
890 return false;
891 }
892 *fd_out = fd;
893 *device_out = before.st_dev;
894 *inode_out = before.st_ino;
895 return true;
896}
897
898static bool endpoint_runtime_still_valid(const cbm_daemon_ipc_endpoint_t *endpoint) {
899 if (!endpoint || endpoint->dir_fd < 0) {

Callers 1

Calls 3

private_runtime_snapshotFunction · 0.85
closeFunction · 0.50

Tested by

no test coverage detected