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

Function ipc_retry_pause

src/daemon/ipc.c:604–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602}
603
604static bool ipc_retry_pause(uint64_t deadline_ms) {
605 int remaining_ms = deadline_remaining_ms(deadline_ms);
606 if (remaining_ms <= 0) {
607 return false;
608 }
609 int pause_ms = remaining_ms < CBM_DAEMON_IPC_RETRY_INTERVAL_MS
610 ? remaining_ms
611 : CBM_DAEMON_IPC_RETRY_INTERVAL_MS;
612 struct timespec pause = {
613 .tv_sec = 0,
614 .tv_nsec = (long)pause_ms * 1000000L,
615 };
616 while (nanosleep(&pause, &pause) != 0 && errno == EINTR) {}
617 return true;
618}
619
620static bool fd_set_cloexec(int fd) {
621 int flags = fcntl(fd, F_GETFD);

Callers 1

cbm_daemon_ipc_connectFunction · 0.85

Calls 1

deadline_remaining_msFunction · 0.85

Tested by

no test coverage detected