]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
srvsvc: Use a struct assignment in enum_file_fn()
authorVolker Lendecke <vl@samba.org>
Tue, 21 Apr 2020 12:21:49 +0000 (14:21 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 6 Aug 2020 13:32:39 +0000 (13:32 +0000)
Looks nicer than 5 complex array references...

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14355

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit ff80f68c3020be0a92eb41115a64518ece097ee7)

source3/rpc_server/srvsvc/srv_srvsvc_nt.c

index c98323bd72993814cb5f1d89842adbe88d0e9849..b81de3d2b9ecc1873c8289f81b6ebe1fce5e6dab 100644 (file)
@@ -154,12 +154,14 @@ static int enum_file_fn(struct file_id id,
 
        /* now fill in the srvsvc_NetFileInfo3 struct */
 
-       ctr3->array[i].fid              =
-               (((uint32_t)(procid_to_pid(&e->pid))<<16) | e->share_file_id);
-       ctr3->array[i].permissions      = permissions;
-       ctr3->array[i].num_locks                = num_locks;
-       ctr3->array[i].path             = fullpath;
-       ctr3->array[i].user             = username;
+       ctr3->array[i] = (struct srvsvc_NetFileInfo3) {
+               .fid            = (((uint32_t)(procid_to_pid(&e->pid))<<16) |
+                                  e->share_file_id),
+               .permissions    = permissions,
+               .num_locks      = num_locks,
+               .path           = fullpath,
+               .user           = username,
+       };
 
        ctr3->count++;