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

Function tf_coverage_channel_finish

tests/test_main.c:1280–1303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1278}
1279
1280static void tf_coverage_channel_finish(void) {
1281 if (!tf_coverage_channel.active || getpid() != tf_coverage_channel.owner) {
1282 return;
1283 }
1284 tf_coverage_channel_observe();
1285 tf_coverage_channel.active = false;
1286 if (tf_coverage_channel.fd[0] == tf_coverage_channel.fd[1]) {
1287 tf_coverage_channel_fail("channel-invalid");
1288 tf_coverage_channel.fd[0] = tf_coverage_channel.fd[1] = -1;
1289 return;
1290 }
1291 for (int i = 0; i < 2; i++) {
1292 int fd = tf_coverage_channel.fd[i];
1293 bool owned = tf_coverage_channel_end(i, false);
1294 tf_coverage_channel.fd[i] = -1;
1295 if (!owned) {
1296 /* Do not close a detectable replacement. Unknown ownership remains
1297 * for kernel process-exit cleanup, never a blind retry/close. */
1298 tf_coverage_channel_fail("channel-invalid");
1299 } else if (close(fd) != 0) {
1300 tf_coverage_channel_fail("channel-close");
1301 }
1302 }
1303}
1304
1305/* Fixed storage and descriptor syscalls only in the post-fork failure path.
1306 * EAGAIN is evidence solely under intact, never-drained exclusive custody.

Callers 2

tf_coverage_initFunction · 0.85
mainFunction · 0.85

Calls 4

tf_coverage_channel_failFunction · 0.85
tf_coverage_channel_endFunction · 0.85
closeFunction · 0.50

Tested by

no test coverage detected