smbd: Use a direct struct assignment in reply_setatr()
authorVolker Lendecke <vl@samba.org>
Sun, 14 Apr 2019 08:50:10 +0000 (10:50 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 16 May 2019 06:46:18 +0000 (06:46 +0000)
Saves .text bytes with -O3

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/reply.c

index 199542e8ae0da8b4a473dce54d2d36161b68e973..56b82616ac0b992b45df8ca75a91b8bfb7ce5226 100644 (file)
@@ -1489,8 +1489,6 @@ void reply_setatr(struct smb_request *req)
 
        START_PROFILE(SMBsetatr);
 
-       ZERO_STRUCT(ft);
-
        if (req->wct < 2) {
                reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
                goto out;
@@ -1552,7 +1550,10 @@ void reply_setatr(struct smb_request *req)
                }
        }
 
-       ft.mtime = convert_time_t_to_timespec(mtime);
+       ft = (struct smb_file_time) {
+               .mtime = convert_time_t_to_timespec(mtime)
+       };
+
        status = smb_set_file_time(conn, NULL, smb_fname, &ft, true);
        if (!NT_STATUS_IS_OK(status)) {
                reply_nterror(req, status);