From 1c4027678e7300580cdb4122f19261afedcbad6c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 6 Apr 2009 20:52:04 +0200 Subject: [PATCH] Correct sync wrappers in cli_pipe.c --- source3/rpc_client/cli_pipe.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 6b83c170f57..a8cc33f585e 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2291,19 +2291,24 @@ NTSTATUS rpc_api_pipe_req(TALLOC_CTX *mem_ctx, struct rpc_pipe_client *cli, TALLOC_CTX *frame = talloc_stackframe(); struct event_context *ev; struct tevent_req *req; - NTSTATUS status = NT_STATUS_NO_MEMORY; + NTSTATUS status = NT_STATUS_OK; ev = event_context_init(frame); if (ev == NULL) { + status = NT_STATUS_NO_MEMORY; goto fail; } req = rpc_api_pipe_req_send(frame, ev, cli, op_num, in_data); if (req == NULL) { + status = NT_STATUS_NO_MEMORY; goto fail; } - tevent_req_poll(req, ev); + if (!tevent_req_poll(req, ev)) { + status = map_nt_error_from_unix(errno); + goto fail; + } status = rpc_api_pipe_req_recv(req, mem_ctx, out_data); fail: @@ -2905,19 +2910,24 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli, TALLOC_CTX *frame = talloc_stackframe(); struct event_context *ev; struct tevent_req *req; - NTSTATUS status = NT_STATUS_NO_MEMORY; + NTSTATUS status = NT_STATUS_OK; ev = event_context_init(frame); if (ev == NULL) { + status = NT_STATUS_NO_MEMORY; goto fail; } req = rpc_pipe_bind_send(frame, ev, cli, auth); if (req == NULL) { + status = NT_STATUS_NO_MEMORY; goto fail; } - tevent_req_poll(req, ev); + if (!tevent_req_poll(req, ev)) { + status = map_nt_error_from_unix(errno); + goto fail; + } status = rpc_pipe_bind_recv(req); fail: -- 2.34.1