* fsyncing, and might not have privileges to write at all.
*
* serverVersion indicates the version of the server to be fsync'd.
- *
- * Errors are reported but not considered fatal.
*/
void
fsync_pgdata(const char *pg_data,
* fsync_fname -- Try to fsync a file or directory
*
* Ignores errors trying to open unreadable files, or trying to fsync
- * directories on systems where that isn't allowed/required. Reports
- * other errors non-fatally.
+ * directories on systems where that isn't allowed/required. All other errors
+ * are fatal.
*/
int
fsync_fname(const char *fname, bool isdir)
*/
if (returncode != 0 && !(isdir && (errno == EBADF || errno == EINVAL)))
{
- pg_log_error("could not fsync file \"%s\": %m", fname);
+ pg_log_fatal("could not fsync file \"%s\": %m", fname);
(void) close(fd);
- return -1;
+ exit(EXIT_FAILURE);
}
(void) close(fd);
{
if (fsync(fd) != 0)
{
- pg_log_error("could not fsync file \"%s\": %m", newfile);
+ pg_log_fatal("could not fsync file \"%s\": %m", newfile);
close(fd);
- return -1;
+ exit(EXIT_FAILURE);
}
close(fd);
}