MCPcopy Create free account
hub / github.com/antirez/ds4 / agent_bash_drain

Function agent_bash_drain

ds4_agent.c:6728–6741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6726 fclose(fp);
6727 free(buf);
6728 snprintf(err, errlen, "file too large: %s exceeds %d bytes",
6729 path, AGENT_FILE_MAX_BYTES);
6730 return -1;
6731 }
6732 if (used + n + 1 > cap) {
6733 cap = cap ? cap * 2 : 8192;
6734 while (cap < used + n + 1) cap *= 2;
6735 buf = xrealloc(buf, cap);
6736 }
6737 memcpy(buf + used, tmp, n);
6738 used += n;
6739 buf[used] = '\0';
6740 }
6741 if (n < sizeof(tmp)) {
6742 if (ferror(fp)) {
6743 snprintf(err, errlen, "read %s: %s", path, strerror(errno));
6744 fclose(fp);

Callers 2

agent_bash_finalizeFunction · 0.85
agent_bash_pollFunction · 0.85

Calls 2

agent_bash_note_outputFunction · 0.85
write_allFunction · 0.85

Tested by

no test coverage detected