MCPcopy Create free account
hub / github.com/apache/cloudberry / write_binary_to_file

Function write_binary_to_file

src/backend/postmaster/syslogger.c:1699–1720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1697}
1698
1699static void
1700write_binary_to_file(const char *buffer, int count, FILE *fh)
1701{
1702 int rc;
1703
1704#ifndef WIN32
1705 rc = fwrite(buffer, 1, count, fh);
1706#else
1707 EnterCriticalSection(&fileSection);
1708 rc = fwrite(buffer, 1, count, fh);
1709 LeaveCriticalSection(&fileSection);
1710#endif
1711
1712 /*
1713 * Try to report any failure. We mustn't use ereport because it would
1714 * just recurse right back here, but write_stderr is OK: it will write
1715 * either to the postmaster's original stderr, or to /dev/null, but never
1716 * to our input pipe which would result in a different sort of looping.
1717 */
1718 if (rc != count)
1719 write_stderr("could not write to log file: %s\n", strerror(errno));
1720}
1721
1722
1723/* --------------------------------

Callers 1

Calls 1

write_stderrFunction · 0.50

Tested by

no test coverage detected