len = xlrec->num_mappings * sizeof(LogicalRewriteMappingData);
/* write out tail end of mapping file (again) */
+ errno = 0;
pgstat_report_wait_start(WAIT_EVENT_LOGICAL_REWRITE_MAPPING_WRITE);
if (write(fd, data, len) != len)
{
errmsg("could not recreate file \"%s\": %m", path)));
/* Write content and CRC */
+ errno = 0;
pgstat_report_wait_start(WAIT_EVENT_TWOPHASE_FILE_WRITE);
if (write(fd, content, len) != len)
{
tmppath)));
/* write magic */
+ errno = 0;
if ((write(tmpfd, &magic, sizeof(magic))) != sizeof(magic))
{
int save_errno = errno;
/* make sure we only write out a commit that's persistent */
XLogFlush(local_lsn);
+ errno = 0;
if ((write(tmpfd, &disk_state, sizeof(disk_state))) !=
sizeof(disk_state))
{
/* write out the CRC */
FIN_CRC32C(crc);
+ errno = 0;
if ((write(tmpfd, &crc, sizeof(crc))) != sizeof(crc))
{
int save_errno = errno;
zerobuf = pg_malloc0(XLOG_BLCKSZ);
for (bytes = 0; bytes < pad_to_size; bytes += XLOG_BLCKSZ)
{
+ errno = 0;
if (write(fd, zerobuf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
{
int save_errno = errno;
{
size_t len = ZLIB_OUT_SIZE - tar_data->zp->avail_out;
+ errno = 0;
if (write(tar_data->fd, tar_data->zlibOut, len) != len)
{
/*
if (!tar_data->compression)
{
+ errno = 0;
if (write(tar_data->fd, tar_data->currentfile->header, 512) != 512)
{
save_errno = errno;
return -1;
if (!tar_data->compression)
{
+ errno = 0;
if (write(tar_data->fd, tf->header, 512) != 512)
{
/* if write didn't set errno, assume problem is no disk space */
MemSet(zerobuf, 0, sizeof(zerobuf));
if (!tar_data->compression)
{
+ errno = 0;
if (write(tar_data->fd, zerobuf, sizeof(zerobuf)) != sizeof(zerobuf))
{
/* if write didn't set errno, assume problem is no disk space */
{
size_t len = ZLIB_OUT_SIZE - tar_data->zp->avail_out;
+ errno = 0;
if (write(tar_data->fd, tar_data->zlibOut, len) != len)
{
/*