]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpc_client: Simplify get_complete_frag_got_rest()
authorVolker Lendecke <vl@samba.org>
Fri, 6 Aug 2021 10:14:23 +0000 (12:14 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 24 Aug 2021 17:32:29 +0000 (17:32 +0000)
tevent_req_simple_finish_ntstatus() is made precisely for this simple
case where we just pass on a subreq's NTSTATUS

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

index 193a99cb6eec40567025f24a54f51957b8e02332..dd4e29addffea89187a28bd9a69dd934fc4c032c 100644 (file)
@@ -357,17 +357,8 @@ static void get_complete_frag_got_header(struct tevent_req *subreq)
 
 static void get_complete_frag_got_rest(struct tevent_req *subreq)
 {
-       struct tevent_req *req = tevent_req_callback_data(
-               subreq, struct tevent_req);
-       NTSTATUS status;
-
-       status = rpc_read_recv(subreq);
-       TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
-               tevent_req_nterror(req, status);
-               return;
-       }
-       tevent_req_done(req);
+       NTSTATUS status = rpc_read_recv(subreq);
+       return tevent_req_simple_finish_ntstatus(subreq, status);
 }
 
 static NTSTATUS get_complete_frag_recv(struct tevent_req *req)