We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentd1d3f4d commit849b070Copy full SHA for 849b070
src/port/open.c
@@ -6,7 +6,7 @@
6
*
7
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
8
9
- * $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 $
10
11
*-------------------------------------------------------------------------
12
*/
@@ -25,20 +25,23 @@ openFlagsToCreateFileFlags(int openFlags)
25
{
26
switch (openFlags& (O_CREAT |O_TRUNC |O_EXCL))
27
28
+/* O_EXCL is meaningless without O_CREAT */
29
case0:
30
caseO_EXCL:
31
returnOPEN_EXISTING;
32
33
caseO_CREAT:
34
returnOPEN_ALWAYS;
35
36
37
caseO_TRUNC:
38
caseO_TRUNC |O_EXCL:
39
returnTRUNCATE_EXISTING;
40
41
caseO_CREAT |O_TRUNC:
42
returnCREATE_ALWAYS;
43
44
+/* O_TRUNC is meaningless with O_CREAT */
45
caseO_CREAT |O_EXCL:
46
caseO_CREAT |O_TRUNC |O_EXCL:
47
returnCREATE_NEW;