diff options
author | Bruce Momjian <bruce@momjian.us> | 2007-02-13 02:06:22 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2007-02-13 02:06:22 +0000 |
commit | 849b0707079e3ba676e2e5407322f20f14f8b076 (patch) | |
tree | 81746856d5311a430ade18ed54a8bffe60ddb0dd | |
parent | d1d3f4d0150d3b3d96b9353d93c676abcf4f074b (diff) | |
download | postgresql-849b0707079e3ba676e2e5407322f20f14f8b076.tar.gz postgresql-849b0707079e3ba676e2e5407322f20f14f8b076.zip |
Add comment to explain why O_EXCL and O_TRUNC can be ignored in
openFlagsToCreateFileFlags() in certain cases.
-rw-r--r-- | src/port/open.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/port/open.c b/src/port/open.c index a413176e3a9..f68b54cb6b3 100644 --- a/src/port/open.c +++ b/src/port/open.c @@ -6,7 +6,7 @@ * * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/port/open.c,v 1.18 2007/01/05 22:20:02 momjian Exp $ + * $PostgreSQL: pgsql/src/port/open.c,v 1.19 2007/02/13 02:06:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -25,6 +25,7 @@ openFlagsToCreateFileFlags(int openFlags) { switch (openFlags & (O_CREAT | O_TRUNC | O_EXCL)) { + /* O_EXCL is meaningless without O_CREAT */ case 0: case O_EXCL: return OPEN_EXISTING; @@ -32,6 +33,7 @@ openFlagsToCreateFileFlags(int openFlags) case O_CREAT: return OPEN_ALWAYS; + /* O_EXCL is meaningless without O_CREAT */ case O_TRUNC: case O_TRUNC | O_EXCL: return TRUNCATE_EXISTING; @@ -39,6 +41,7 @@ openFlagsToCreateFileFlags(int openFlags) case O_CREAT | O_TRUNC: return CREATE_ALWAYS; + /* O_TRUNC is meaningless with O_CREAT */ case O_CREAT | O_EXCL: case O_CREAT | O_TRUNC | O_EXCL: return CREATE_NEW; |