}
/* fsync file in case of a previous crash */
- if (!stream->walmethod->fsync(f))
+ if (!stream->walmethod->sync(f))
{
stream->walmethod->close(f, CLOSE_UNLINK);
return false;
*/
if (stream->synchronous && lastFlushPosition < blockpos && walfile != NULL)
{
- if (stream->walmethod->fsync(walfile) != 0)
+ if (stream->walmethod->sync(walfile) != 0)
{
fprintf(stderr, _("%s: could not fsync file \"%s\": %s\n"),
progname, current_walfile_name, stream->walmethod->getlasterror());
* data has been successfully replicated or not, at the normal
* shutdown of the server.
*/
- if (stream->walmethod->fsync(walfile) != 0)
+ if (stream->walmethod->sync(walfile) != 0)
{
fprintf(stderr, _("%s: could not fsync file \"%s\": %s\n"),
progname, current_walfile_name, stream->walmethod->getlasterror());
}
static int
-dir_fsync(Walfile f)
+dir_sync(Walfile f)
{
Assert(f != NULL);
method->get_current_pos = dir_get_current_pos;
method->get_file_size = dir_get_file_size;
method->close = dir_close;
- method->fsync = dir_fsync;
+ method->sync = dir_sync;
method->existsfile = dir_existsfile;
method->finish = dir_finish;
method->getlasterror = dir_getlasterror;
}
static int
-tar_fsync(Walfile f)
+tar_sync(Walfile f)
{
Assert(f != NULL);
tar_clear_error();
return -1;
/* Always fsync on close, so the padding gets fsynced */
- tar_fsync(f);
+ tar_sync(f);
/* Clean up and done */
pg_free(tf->pathname);
method->get_current_pos = tar_get_current_pos;
method->get_file_size = tar_get_file_size;
method->close = tar_close;
- method->fsync = tar_fsync;
+ method->sync = tar_sync;
method->existsfile = tar_existsfile;
method->finish = tar_finish;
method->getlasterror = tar_getlasterror;
ssize_t (*write) (Walfile f, const void *buf, size_t count);
off_t (*get_current_pos) (Walfile f);
- int (*fsync) (Walfile f);
+ int (*sync) (Walfile f);
bool (*finish) (void);
char *(*getlasterror) (void);
};