s3: Slightly simplify fd_open_atomic
authorVolker Lendecke <vl@samba.org>
Mon, 3 Sep 2012 10:57:18 +0000 (12:57 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 4 Sep 2012 23:56:46 +0000 (01:56 +0200)
Replace an if-statement by a direct assignment

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep  5 01:56:46 CEST 2012 on sn-devel-104

source3/smbd/open.c

index a4d4a3de314bbfe3b995617119ee5e3544ef42bb..6378521d761c6c27e1b73a067b731e7eb094f126 100644 (file)
@@ -563,14 +563,13 @@ static NTSTATUS fd_open_atomic(struct connection_struct *conn,
                 * Fail if already exists, just pass through.
                 */
                status = fd_open(conn, fsp, flags, mode);
-               if (NT_STATUS_IS_OK(status)) {
-                       /*
-                        * Here we've opened with O_CREAT|O_EXCL
-                        * and got success. We *know* we created
-                        * this file.
-                        */
-                       *file_created = true;
-               }
+
+               /*
+                * Here we've opened with O_CREAT|O_EXCL. If that went
+                * NT_STATUS_OK, we *know* we created this file.
+                */
+               *file_created = NT_STATUS_IS_OK(status);
+
                return status;
        }