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

Commit849b070

Browse files
committed
Add comment to explain why O_EXCL and O_TRUNC can be ignored in
openFlagsToCreateFileFlags() in certain cases.
1 parentd1d3f4d commit849b070

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/port/open.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
88
*
9-
* $PostgreSQL: pgsql/src/port/open.c,v 1.18 2007/01/05 22:20:02 momjian Exp $
9+
* $PostgreSQL: pgsql/src/port/open.c,v 1.19 2007/02/13 02:06:22 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -25,20 +25,23 @@ openFlagsToCreateFileFlags(int openFlags)
2525
{
2626
switch (openFlags& (O_CREAT |O_TRUNC |O_EXCL))
2727
{
28+
/* O_EXCL is meaningless without O_CREAT */
2829
case0:
2930
caseO_EXCL:
3031
returnOPEN_EXISTING;
3132

3233
caseO_CREAT:
3334
returnOPEN_ALWAYS;
3435

36+
/* O_EXCL is meaningless without O_CREAT */
3537
caseO_TRUNC:
3638
caseO_TRUNC |O_EXCL:
3739
returnTRUNCATE_EXISTING;
3840

3941
caseO_CREAT |O_TRUNC:
4042
returnCREATE_ALWAYS;
4143

44+
/* O_TRUNC is meaningless with O_CREAT */
4245
caseO_CREAT |O_EXCL:
4346
caseO_CREAT |O_TRUNC |O_EXCL:
4447
returnCREATE_NEW;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp