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

Function bootstrap_daemon_grandchild

src/daemon/bootstrap.c:939–955  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

937}
938
939static void bootstrap_daemon_grandchild(const cbm_daemon_bootstrap_launch_spec_t *spec) {
940 (void)umask(077);
941 sigset_t empty;
942 (void)sigemptyset(&empty);
943 (void)sigprocmask(SIG_SETMASK, &empty, NULL);
944 int null_fd = open("/dev/null", O_RDWR);
945 if (null_fd < 0 || dup2(null_fd, STDIN_FILENO) < 0 || dup2(null_fd, STDOUT_FILENO) < 0 ||
946 dup2(null_fd, STDERR_FILENO) < 0) {
947 _exit(127);
948 }
949 if (null_fd > STDERR_FILENO) {
950 (void)close(null_fd);
951 }
952 bootstrap_child_close_fds();
953 execv(spec->executable_path, (char *const *)spec->argv);
954 _exit(127);
955}
956
957static bool bootstrap_production_spawn(void *context,
958 const cbm_daemon_bootstrap_launch_spec_t *spec) {

Callers 1

Calls 1

Tested by

no test coverage detected