]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Slightly optimize reply_open_and_X()
authorVolker Lendecke <vl@samba.org>
Fri, 26 Jul 2019 14:20:17 +0000 (16:20 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 6 Aug 2019 21:49:29 +0000 (21:49 +0000)
Well, this is just a drive-by patch: We don't use "mtime" if we
exit early. So it's not really a worthwhile optimization, to me
it's more a code clarity thing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/reply.c

index d01b39a55387a21f1a180f80159773ea088879b7..946acb130d5415cc3b1e15d38dedfeff156b6d96 100644 (file)
@@ -2525,12 +2525,12 @@ void reply_open_and_X(struct smb_request *req)
        }
 
        fattr = dos_mode(conn, fsp->fsp_name);
-       mtime = convert_timespec_to_time_t(fsp->fsp_name->st.st_ex_mtime);
        if (fattr & FILE_ATTRIBUTE_DIRECTORY) {
                close_file(req, fsp, ERROR_CLOSE);
                reply_nterror(req, NT_STATUS_ACCESS_DENIED);
                goto out;
        }
+       mtime = convert_timespec_to_time_t(fsp->fsp_name->st.st_ex_mtime);
 
        /* If the caller set the extended oplock request bit
                and we granted one (by whatever means) - set the