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/libsmb/async_smb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 3ed38718c1..8fdcac47a9 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -340,8 +340,7 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx, state->iov_count = iov_count + 3; if (cli->timeout) { - endtime = timeval_current_ofs(cli->timeout / 1000, - (cli->timeout % 1000) * 1000); + endtime = timeval_current_ofs_msec(cli->timeout); if (!tevent_req_set_endtime(result, ev, endtime)) { tevent_req_nomem(NULL, result); } -- cgit