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

Function ipc_retry_pause

src/daemon/ipc.c:776–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

774}
775
776static bool ipc_retry_pause(uint64_t deadline_ms) {
777 int remaining_ms = deadline_remaining_ms(deadline_ms);
778 if (remaining_ms <= 0) {
779 return false;
780 }
781 int pause_ms = remaining_ms < CBM_DAEMON_IPC_RETRY_INTERVAL_MS
782 ? remaining_ms
783 : CBM_DAEMON_IPC_RETRY_INTERVAL_MS;
784 struct timespec pause = {
785 .tv_sec = 0,
786 .tv_nsec = (long)pause_ms * 1000000L,
787 };
788 while (nanosleep(&pause, &pause) != 0 && errno == EINTR) {}
789 return true;
790}
791
792static bool fd_set_cloexec(int fd) {
793 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