s3: Slightly simplify open_file_ntcreate
authorVolker Lendecke <vl@samba.org>
Sun, 2 Sep 2012 10:53:04 +0000 (12:53 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 4 Sep 2012 22:15:00 +0000 (15:15 -0700)
We have not set flags2 before, so do direct assignment and not |=

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 5714157970be7cce4089bae51435a7fadf734466..dc775dceab5ba860c09d278109506ddbf35f0ac6 100644 (file)
@@ -1942,14 +1942,14 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                case FILE_SUPERSEDE:
                        /* If file exists replace/overwrite. If file doesn't
                         * exist create. */
-                       flags2 |= (O_CREAT | O_TRUNC);
+                       flags2 = (O_CREAT | O_TRUNC);
                        clear_ads = true;
                        break;
 
                case FILE_OVERWRITE_IF:
                        /* If file exists replace/overwrite. If file doesn't
                         * exist create. */
-                       flags2 |= (O_CREAT | O_TRUNC);
+                       flags2 = (O_CREAT | O_TRUNC);
                        clear_ads = true;
                        break;
 
@@ -1976,7 +1976,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                                errno = ENOENT;
                                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
                        }
-                       flags2 |= O_TRUNC;
+                       flags2 = O_TRUNC;
                        clear_ads = true;
                        break;
 
@@ -1995,13 +1995,13 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                                }
                                return map_nt_error_from_unix(errno);
                        }
-                       flags2 |= (O_CREAT|O_EXCL);
+                       flags2 = (O_CREAT|O_EXCL);
                        break;
 
                case FILE_OPEN_IF:
                        /* If file exists open. If file doesn't exist
                         * create. */
-                       flags2 |= O_CREAT;
+                       flags2 = O_CREAT;
                        break;
 
                default: