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

Function tf_coverage_channel_end

tests/test_main.c:1160–1185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1158}
1159
1160static bool tf_coverage_channel_end(int index, bool require_flags) {
1161 int fd = tf_coverage_channel.fd[index];
1162 struct stat current;
1163 if (fd < 0) {
1164 return false;
1165 }
1166 int status;
1167 do {
1168 status = fstat(fd, &current);
1169 } while (status < 0 && errno == EINTR);
1170 if (status != 0 || !S_ISFIFO(current.st_mode) ||
1171 current.st_dev != tf_coverage_channel.identity[index].st_dev ||
1172 current.st_ino != tf_coverage_channel.identity[index].st_ino) {
1173 return false;
1174 }
1175 int flags = tf_coverage_channel_flags(fd, F_GETFL);
1176 if (flags < 0 || (flags & O_ACCMODE) != (index == 0 ? O_RDONLY : O_WRONLY)) {
1177 return false;
1178 }
1179 if (!require_flags) {
1180 return true;
1181 }
1182 int descriptor_flags = tf_coverage_channel_flags(fd, F_GETFD);
1183 return (flags & O_NONBLOCK) != 0 && descriptor_flags >= 0 &&
1184 (descriptor_flags & FD_CLOEXEC) != 0;
1185}
1186
1187static bool tf_coverage_channel_intact(void) {
1188 return tf_coverage_channel.fd[0] >= 0 && tf_coverage_channel.fd[1] >= 0 &&

Callers 2

Calls 1

Tested by

no test coverage detected