aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r--src/backend/storage/file/fd.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index abb054ad7f3..5d5e8ae94e0 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -1065,13 +1065,7 @@ tryAgain:
*/
StaticAssertStmt((PG_O_DIRECT &
(O_APPEND |
-#if defined(O_CLOEXEC)
- O_CLOEXEC |
-#endif
O_CREAT |
-#if defined(O_DSYNC)
- O_DSYNC |
-#endif
O_EXCL |
O_RDWR |
O_RDONLY |
@@ -1079,6 +1073,15 @@ tryAgain:
O_TRUNC |
O_WRONLY)) == 0,
"PG_O_DIRECT value collides with standard flag");
+#if defined(O_CLOEXEC)
+ StaticAssertStmt((PG_O_DIRECT & O_CLOEXEC) == 0,
+ "PG_O_DIRECT value collides with O_CLOEXEC");
+#endif
+#if defined(O_DSYNC)
+ StaticAssertStmt((PG_O_DIRECT & O_DSYNC) == 0,
+ "PG_O_DIRECT value collides with O_DSYNC");
+#endif
+
fd = open(fileName, fileFlags & ~PG_O_DIRECT, fileMode);
#else
fd = open(fileName, fileFlags, fileMode);