if (wb < 0)
pg_fatal("could not write file \"%s\": %m", output_filename);
else
- pg_fatal("could not write file \"%s\": wrote only %d of %d bytes",
+ pg_fatal("could not write file \"%s\": wrote %d of %d",
output_filename, (int) wb, (int) (e - s));
}
if (pg_checksum_update(&checksum_ctx, (uint8 *) s, e - s) < 0)
}
if (close(output_fd) != 0)
- pg_fatal("could not close \"%s\": %m", output_filename);
+ pg_fatal("could not close file \"%s\": %m", output_filename);
checksum_length = pg_checksum_final(&checksum_ctx, checksum_payload);
int fd;
if ((fd = open(src, O_RDONLY | PG_BINARY, 0)) < 0)
- pg_fatal("could not open \"%s\": %m", src);
+ pg_fatal("could not open file \"%s\": %m", src);
if (close(fd) < 0)
- pg_fatal("could not close \"%s\": %m", src);
+ pg_fatal("could not close file \"%s\": %m", src);
}
#ifdef WIN32
if ((wb = write(dest_fd, buffer, rb)) != rb)
{
if (wb < 0)
- pg_fatal("could not write file \"%s\": %m", dst);
+ pg_fatal("could not write to file \"%s\": %m", dst);
else
- pg_fatal("could not write file \"%s\": wrote only %d of %d bytes at offset %u",
- dst, (int) wb, (int) rb, offset);
+ pg_fatal("could not write to file \"%s\", offset %u: wrote %d of %d",
+ dst, offset, (int) wb, (int) rb);
}
if (pg_checksum_update(checksum_ctx, buffer, rb) < 0)
}
if (rb < 0)
- pg_fatal("could not read file \"%s\": %m", dst);
+ pg_fatal("could not read from file \"%s\": %m", dst);
pg_free(buffer);
close(src_fd);
if (CopyFile(src, dst, true) == 0)
{
_dosmaperr(GetLastError());
- pg_fatal("could not copy \"%s\" to \"%s\": %m", src, dst);
+ pg_fatal("could not copy file \"%s\" to \"%s\": %m", src, dst);
}
/* if needed, calculate checksum of the file */
{
if (errno == ENOENT)
{
- pg_log_warning("\"%s\" does not exist", pathname);
+ pg_log_warning("file \"%s\" does not exist", pathname);
return NULL;
}
pg_fatal("could not open file \"%s\": %m", pathname);
/* Close the file. */
if (close(fd) != 0)
- pg_fatal("could not close \"%s\": %m", pathbuf);
+ pg_fatal("could not close file \"%s\": %m", pathbuf);
/* Parse the file contents. */
parse_backup_label(pathbuf, buf, &start_tli, &start_lsn,
struct stat st;
if (stat(dir, &st) != 0)
- pg_fatal("could not stat \"%s\": %m", dir);
+ pg_fatal("could not stat file \"%s\": %m", dir);
SetDataDirectoryCreatePerm(st.st_mode);
}
/* Close the file. */
if (close(fd) != 0)
- pg_fatal("could not close \"%s\": %m", filename);
+ pg_fatal("could not close file \"%s\": %m", filename);
/* Convert to integer. */
errno = 0;
}
/* Debugging output. */
- pg_log_debug("read server version %d from \"%s\"", version, filename);
+ pg_log_debug("read server version %d from file \"%s\"", version, filename);
/* Release memory and return result. */
pfree(buf.data);
pg_fatal("could not read symbolic link \"%s\": %m",
tblspcdir);
if (link_length >= sizeof(link_target))
- pg_fatal("symbolic link \"%s\" is too long", tblspcdir);
+ pg_fatal("target of symbolic link \"%s\" is too long", tblspcdir);
link_target[link_length] = '\0';
if (!is_absolute_path(link_target))
- pg_fatal("symbolic link \"%s\" is relative", tblspcdir);
+ pg_fatal("target of symbolic link \"%s\" is relative", tblspcdir);
/* Canonicalize the link target. */
canonicalize_path(link_target);
/* Tablespaces should not share a directory. */
for (otherts = tslist; otherts != NULL; otherts = otherts->next)
if (strcmp(ts->new_dir, otherts->new_dir) == 0)
- pg_fatal("tablespaces with OIDs %u and %u both point at \"%s\"",
+ pg_fatal("tablespaces with OIDs %u and %u both point at directory \"%s\"",
otherts->oid, oid, ts->new_dir);
/* Add this tablespace to the list. */
/* Check file size, and complain if it's too large. */
if (fstat(fd, &st) != 0)
- pg_fatal("could not stat \"%s\": %m", filename);
+ pg_fatal("could not stat file \"%s\": %m", filename);
if (st.st_size > maxlen)
pg_fatal("file \"%s\" is too large", filename);
if (rb < 0)
pg_fatal("could not read file \"%s\": %m", filename);
else
- pg_fatal("could not read file \"%s\": read only %zd of %lld bytes",
+ pg_fatal("could not read file \"%s\": read %zd of %lld",
filename, rb, (long long int) st.st_size);
}
/* We need to know the length of the file. */
if (fstat(s->fd, &sb) < 0)
- pg_fatal("could not stat \"%s\": %m", s->filename);
+ pg_fatal("could not stat file \"%s\": %m", s->filename);
/*
* Since we found a full file, source all blocks from it that
* The directory is out of sync with the backup_manifest, so emit
* a warning.
*/
- /*- translator: the first %s is a backup manifest file, the second is a file absent therein */
- pg_log_warning("\"%s\" contains no entry for \"%s\"",
+ pg_log_warning("manifest file \"%s\" contains no entry for file \"%s\"",
path,
manifest_path);
pfree(path);
if (s == NULL)
continue;
if (close(s->fd) != 0)
- pg_fatal("could not close \"%s\": %m", s->filename);
+ pg_fatal("could not close file \"%s\": %m", s->filename);
if (s->relative_block_numbers != NULL)
pfree(s->relative_block_numbers);
pg_free(s->filename);
struct stat sb;
if (fstat(s->fd, &sb) < 0)
- pg_fatal("could not stat \"%s\": %m", s->filename);
+ pg_fatal("could not stat file \"%s\": %m", s->filename);
if (sb.st_size < s->highest_offset_read)
pg_fatal("file \"%s\" is too short: expected %llu, found %llu",
s->filename,
if (rb < 0)
pg_fatal("could not read file \"%s\": %m", rf->filename);
else
- pg_fatal("could not read file \"%s\": read only %d of %u bytes",
+ pg_fatal("could not read file \"%s\": read %d of %u",
rf->filename, rb, length);
}
}
/* Close the output file. */
if (wfd >= 0 && close(wfd) != 0)
- pg_fatal("could not close \"%s\": %m", output_filename);
+ pg_fatal("could not close file \"%s\": %m", output_filename);
}
/*
if (wb < 0)
pg_fatal("could not write file \"%s\": %m", output_filename);
else
- pg_fatal("could not write file \"%s\": wrote only %d of %d bytes",
+ pg_fatal("could not write file \"%s\": wrote %d of %d",
output_filename, wb, BLCKSZ);
}
if (rb != BLCKSZ)
{
if (rb < 0)
- pg_fatal("could not read file \"%s\": %m", s->filename);
+ pg_fatal("could not read from file \"%s\": %m", s->filename);
else
- pg_fatal("could not read file \"%s\": read only %d of %d bytes at offset %llu",
- s->filename, rb, BLCKSZ,
- (unsigned long long) off);
+ pg_fatal("could not read from file \"%s\", offset %llu: read %d of %d",
+ s->filename, (unsigned long long) off, rb, BLCKSZ);
}
}
/* Close the file. */
if (close(mwriter->fd) != 0)
- pg_fatal("could not close \"%s\": %m", mwriter->pathname);
+ pg_fatal("could not close file \"%s\": %m", mwriter->pathname);
mwriter->fd = -1;
}
if (wb != mwriter->buf.len)
{
if (wb < 0)
- pg_fatal("could not write \"%s\": %m", mwriter->pathname);
+ pg_fatal("could not write file \"%s\": %m", mwriter->pathname);
else
- pg_fatal("could not write file \"%s\": wrote only %d of %d bytes",
+ pg_fatal("could not write file \"%s\": wrote %d of %d",
mwriter->pathname, (int) wb, mwriter->buf.len);
}