Skip to content

Commit eade082

Browse files
committed
Rename walmethod fsync method to sync
Using the name fsync clashed with the #define we have on Windows that redefines it to _commit. Naming it sync should remove that conflict. Per all the Windows buildfarm members
1 parent a5c17c1 commit eade082

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/bin/pg_basebackup/receivelog.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ open_walfile(StreamCtl *stream, XLogRecPtr startpoint)
132132
}
133133

134134
/* fsync file in case of a previous crash */
135-
if (!stream->walmethod->fsync(f))
135+
if (!stream->walmethod->sync(f))
136136
{
137137
stream->walmethod->close(f, CLOSE_UNLINK);
138138
return false;
@@ -768,7 +768,7 @@ HandleCopyStream(PGconn *conn, StreamCtl *stream,
768768
*/
769769
if (stream->synchronous && lastFlushPosition < blockpos && walfile != NULL)
770770
{
771-
if (stream->walmethod->fsync(walfile) != 0)
771+
if (stream->walmethod->sync(walfile) != 0)
772772
{
773773
fprintf(stderr, _("%s: could not fsync file \"%s\": %s\n"),
774774
progname, current_walfile_name, stream->walmethod->getlasterror());
@@ -1011,7 +1011,7 @@ ProcessKeepaliveMsg(PGconn *conn, StreamCtl *stream, char *copybuf, int len,
10111011
* data has been successfully replicated or not, at the normal
10121012
* shutdown of the server.
10131013
*/
1014-
if (stream->walmethod->fsync(walfile) != 0)
1014+
if (stream->walmethod->sync(walfile) != 0)
10151015
{
10161016
fprintf(stderr, _("%s: could not fsync file \"%s\": %s\n"),
10171017
progname, current_walfile_name, stream->walmethod->getlasterror());

src/bin/pg_basebackup/walmethods.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ dir_close(Walfile f, WalCloseMethod method)
219219
}
220220

221221
static int
222-
dir_fsync(Walfile f)
222+
dir_sync(Walfile f)
223223
{
224224
Assert(f != NULL);
225225

@@ -287,7 +287,7 @@ CreateWalDirectoryMethod(const char *basedir, bool sync)
287287
method->get_current_pos = dir_get_current_pos;
288288
method->get_file_size = dir_get_file_size;
289289
method->close = dir_close;
290-
method->fsync = dir_fsync;
290+
method->sync = dir_sync;
291291
method->existsfile = dir_existsfile;
292292
method->finish = dir_finish;
293293
method->getlasterror = dir_getlasterror;
@@ -606,7 +606,7 @@ tar_get_current_pos(Walfile f)
606606
}
607607

608608
static int
609-
tar_fsync(Walfile f)
609+
tar_sync(Walfile f)
610610
{
611611
Assert(f != NULL);
612612
tar_clear_error();
@@ -764,7 +764,7 @@ tar_close(Walfile f, WalCloseMethod method)
764764
return -1;
765765

766766
/* Always fsync on close, so the padding gets fsynced */
767-
tar_fsync(f);
767+
tar_sync(f);
768768

769769
/* Clean up and done */
770770
pg_free(tf->pathname);
@@ -872,7 +872,7 @@ CreateWalTarMethod(const char *tarbase, int compression, bool sync)
872872
method->get_current_pos = tar_get_current_pos;
873873
method->get_file_size = tar_get_file_size;
874874
method->close = tar_close;
875-
method->fsync = tar_fsync;
875+
method->sync = tar_sync;
876876
method->existsfile = tar_existsfile;
877877
method->finish = tar_finish;
878878
method->getlasterror = tar_getlasterror;

src/bin/pg_basebackup/walmethods.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct WalWriteMethod
2929

3030
ssize_t (*write) (Walfile f, const void *buf, size_t count);
3131
off_t (*get_current_pos) (Walfile f);
32-
int (*fsync) (Walfile f);
32+
int (*sync) (Walfile f);
3333
bool (*finish) (void);
3434
char *(*getlasterror) (void);
3535
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy