Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1120c61

Browse files
committed
Revert out:
Update fsync test to match new O_DIRECT behavior.Greg Smith
1 parent3455b0a commit1120c61

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

‎src/tools/fsync/test_fsync.c

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,28 @@
1414
#include<time.h>
1515
#include<sys/time.h>
1616
#include<unistd.h>
17-
#include<string.h>
1817

1918
#ifdefWIN32
2019
#defineFSYNC_FILENAME"./test_fsync.out"
2120
#else
2221
#defineFSYNC_FILENAME"/var/tmp/test_fsync.out"
2322
#endif
2423

25-
/* This logic comes from src/backend/access/transam/xlog.c where it's
26-
better documented */
27-
#ifdefO_DIRECT
28-
#definePG_O_DIRECT O_DIRECT
29-
#else
30-
#definePG_O_DIRECT 0
31-
#endif
32-
24+
/* O_SYNC and O_FSYNC are the same */
3325
#if defined(O_SYNC)
34-
#defineBARE_OPEN_SYNC_FLAGO_SYNC
26+
#defineOPEN_SYNC_FLAGO_SYNC
3527
#elif defined(O_FSYNC)
36-
#defineBARE_OPEN_SYNC_FLAG O_FSYNC
37-
#endif
38-
#ifdefBARE_OPEN_SYNC_FLAG
39-
#defineOPEN_SYNC_FLAG (BARE_OPEN_SYNC_FLAG | PG_O_DIRECT)
28+
#defineOPEN_SYNC_FLAGO_FSYNC
29+
#elif defined(O_DSYNC)
30+
#defineOPEN_DATASYNC_FLAGO_DSYNC
4031
#endif
4132

42-
#if defined(O_DSYNC)
4333
#if defined(OPEN_SYNC_FLAG)
44-
#ifO_DSYNC!=BARE_OPEN_SYNC_FLAG
45-
#defineOPEN_DATASYNC_FLAG (O_DSYNC | PG_O_DIRECT)
46-
#endif
47-
#else
48-
#defineOPEN_DATASYNC_FLAG (O_DSYNC | PG_O_DIRECT)
34+
#if defined(O_DSYNC)&& (O_DSYNC!=OPEN_SYNC_FLAG)
35+
#defineOPEN_DATASYNC_FLAGO_DSYNC
4936
#endif
5037
#endif
5138

52-
5339
#defineWAL_FILE_SIZE(16 * 1024 * 1024)
5440

5541
voiddie(char*str);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp