Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1f45f6

Browse files
committed
Remove obsolete coding for early macOS.
Commits 04cad8f and 0c08856 supported old macOS systems that didn't define O_CLOEXEC or O_DSYNC yet, but those arrived in macOS releases 10.7 and 10.6 (respectively), which themselves reached EOL around a decade ago. We've already made use of other POSIX features that early macOS vintages can't compile (for example commits 623cc67, d2e1508). A later commit will use O_CLOEXEC on POSIX systems so it would be strange to pretend here that it's optional, and we might as well give O_DSYNC the same treatment since the reference is also guarded by a test for a macOS-specific macro, and we know that current Macs have it. Discussion: https://postgr.es/m/CA%2BhUKGKb6FsAdQWcRL35KJsftv%2B9zXqQbzwkfRf1i0J2e57%2BhQ%40mail.gmail.com
1 parent 8427ce4 commit a1f45f6

File tree

1 file changed

+2
-9
lines changed
  • src/backend/storage/file

1 file changed

+2
-9
lines changed

src/backend/storage/file/fd.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,23 +1025,16 @@ BasicOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
10251025
*/
10261026
StaticAssertStmt((PG_O_DIRECT &
10271027
(O_APPEND |
1028+
O_CLOEXEC |
10281029
O_CREAT |
1030+
O_DSYNC |
10291031
O_EXCL |
10301032
O_RDWR |
10311033
O_RDONLY |
10321034
O_SYNC |
10331035
O_TRUNC |
10341036
O_WRONLY)) == 0,
10351037
"PG_O_DIRECT value collides with standard flag");
1036-
#if defined(O_CLOEXEC)
1037-
StaticAssertStmt((PG_O_DIRECT & O_CLOEXEC) == 0,
1038-
"PG_O_DIRECT value collides with O_CLOEXEC");
1039-
#endif
1040-
#if defined(O_DSYNC)
1041-
StaticAssertStmt((PG_O_DIRECT & O_DSYNC) == 0,
1042-
"PG_O_DIRECT value collides with O_DSYNC");
1043-
#endif
1044-
10451038
fd = open(fileName, fileFlags & ~PG_O_DIRECT, fileMode);
10461039
#else
10471040
fd = open(fileName, fileFlags, fileMode);

0 commit comments

Comments
 (0)