File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 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 case 0 :
2930 case O_EXCL :
3031 return OPEN_EXISTING ;
3132
3233 case O_CREAT :
3334 return OPEN_ALWAYS ;
3435
36+ /* O_EXCL is meaningless without O_CREAT */
3537 case O_TRUNC :
3638 case O_TRUNC | O_EXCL :
3739 return TRUNCATE_EXISTING ;
3840
3941 case O_CREAT | O_TRUNC :
4042 return CREATE_ALWAYS ;
4143
44+ /* O_TRUNC is meaningless with O_CREAT */
4245 case O_CREAT | O_EXCL :
4346 case O_CREAT | O_TRUNC | O_EXCL :
4447 return CREATE_NEW ;
You can’t perform that action at this time.
0 commit comments