From 50883cfeb4eed3d538f71443060745f8747044c9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Apr 2011 17:38:09 +0200 Subject: s3-tevent: only include ../lib/util/tevent wrappers where needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104 --- source3/rpc_client/rpc_transport_tstream.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/rpc_client/rpc_transport_tstream.c') diff --git a/source3/rpc_client/rpc_transport_tstream.c b/source3/rpc_client/rpc_transport_tstream.c index 248b09f0491..e62ab4b2bb3 100644 --- a/source3/rpc_client/rpc_transport_tstream.c +++ b/source3/rpc_client/rpc_transport_tstream.c @@ -18,6 +18,7 @@ */ #include "includes.h" +#include "../lib/util/tevent_ntstatus.h" #include "rpc_client/rpc_transport.h" #include "lib/tsocket/tsocket.h" #include "libsmb/cli_np_tstream.h" -- cgit From 56e72337b01216dc7cba418f040a5cc928e5fc6f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 1 Jun 2011 11:21:15 +0930 Subject: lib/util/time.c: timeval_current_ofs_msec Several places want "milliseconds from current time", and several were simply doing "msec * 1000" which can (and does in one place) result in a usec value over 1 a million. Using a helper to do this is safer and more readable. Signed-off-by: Rusty Russell --- source3/rpc_client/rpc_transport_tstream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/rpc_client/rpc_transport_tstream.c') diff --git a/source3/rpc_client/rpc_transport_tstream.c b/source3/rpc_client/rpc_transport_tstream.c index e62ab4b2bb3..488c093d3b7 100644 --- a/source3/rpc_client/rpc_transport_tstream.c +++ b/source3/rpc_client/rpc_transport_tstream.c @@ -202,7 +202,7 @@ static struct tevent_req *rpc_tstream_read_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } - endtime = timeval_current_ofs(0, transp->timeout * 1000); + endtime = timeval_current_ofs_msec(transp->timeout); if (!tevent_req_set_endtime(subreq, ev, endtime)) { goto fail; } @@ -286,7 +286,7 @@ static struct tevent_req *rpc_tstream_write_send(TALLOC_CTX *mem_ctx, goto fail; } - endtime = timeval_current_ofs(0, transp->timeout * 1000); + endtime = timeval_current_ofs_msec(transp->timeout); if (!tevent_req_set_endtime(subreq, ev, endtime)) { goto fail; } @@ -374,7 +374,7 @@ static struct tevent_req *rpc_tstream_trans_send(TALLOC_CTX *mem_ctx, state->req.iov_base = discard_const_p(void *, data); state->max_rdata_len = max_rdata_len; - endtime = timeval_current_ofs(0, transp->timeout * 1000); + endtime = timeval_current_ofs_msec(transp->timeout); subreq = tstream_writev_queue_send(state, ev, transp->stream, -- cgit