s3: Make close_remove_share_mode a bit more readable
authorVolker Lendecke <vl@samba.org>
Fri, 1 Jun 2012 14:13:22 +0000 (16:13 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 3 Jun 2012 15:23:28 +0000 (17:23 +0200)
by introducing a variable simplifying a boolean expression

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/close.c

index e2d7c2c7a7b2ac4230c836ec9d629ee3d177ee0c..d3232aae4f78a21195c2315bc139c691ceea9701 100644 (file)
@@ -341,6 +341,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
        const struct security_unix_token *del_token = NULL;
        const struct security_token *del_nt_token = NULL;
        bool got_tokens = false;
+       bool normal_close;
 
        /* Ensure any pending write time updates are done. */
        if (fsp->update_write_time_event) {
@@ -449,8 +450,9 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
         * reference to a file.
         */
 
-       if (!(close_type == NORMAL_CLOSE || close_type == SHUTDOWN_CLOSE) ||
-                       !delete_file) {
+       normal_close = (close_type == NORMAL_CLOSE || close_type == SHUTDOWN_CLOSE);
+
+       if (!normal_close || !delete_file) {
                TALLOC_FREE(lck);
                return NT_STATUS_OK;
        }