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

Commit0c08856

Browse files
committed
Don't use #if inside function-like macro arguments.
No concrete problem reported, but in the past it's been known to causeproblems on some compilers so let's avoid doing that.Reported-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/234364.1626704007%40sss.pgh.pa.us
1 parent0d2cb6b commit0c08856

File tree

1 file changed

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

1 file changed

+9
-6
lines changed

‎src/backend/storage/file/fd.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,20 +1065,23 @@ BasicOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
10651065
*/
10661066
StaticAssertStmt((PG_O_DIRECT&
10671067
(O_APPEND |
1068-
#if defined(O_CLOEXEC)
1069-
O_CLOEXEC |
1070-
#endif
10711068
O_CREAT |
1072-
#if defined(O_DSYNC)
1073-
O_DSYNC |
1074-
#endif
10751069
O_EXCL |
10761070
O_RDWR |
10771071
O_RDONLY |
10781072
O_SYNC |
10791073
O_TRUNC |
10801074
O_WRONLY))==0,
10811075
"PG_O_DIRECT value collides with standard flag");
1076+
#if defined(O_CLOEXEC)
1077+
StaticAssertStmt((PG_O_DIRECT&O_CLOEXEC)==0,
1078+
"PG_O_DIRECT value collides with O_CLOEXEC");
1079+
#endif
1080+
#if defined(O_DSYNC)
1081+
StaticAssertStmt((PG_O_DIRECT&O_DSYNC)==0,
1082+
"PG_O_DIRECT value collides with O_DSYNC");
1083+
#endif
1084+
10821085
fd=open(fileName,fileFlags& ~PG_O_DIRECT,fileMode);
10831086
#else
10841087
fd=open(fileName,fileFlags,fileMode);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp