From 5e93e3e88fb4a219492c23c18067f358b54311d0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 8 Feb 2011 12:55:02 +0100 Subject: s3: Add timeval_to_msec --- source3/include/proto.h | 1 + source3/lib/util.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/source3/include/proto.h b/source3/include/proto.h index cf58cdf99e..ba0f7adbde 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1180,6 +1180,7 @@ bool tevent_req_poll_ntstatus(struct tevent_req *req, struct tevent_context *ev, NTSTATUS *status); bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result); +int timeval_to_msec(struct timeval t); /* The following definitions come from lib/util_file.c */ diff --git a/source3/lib/util.c b/source3/lib/util.c index 99c4200eb3..81d2a78d3c 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2940,3 +2940,8 @@ bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result) } return false; } + +int timeval_to_msec(struct timeval t) +{ + return t.tv_sec * 1000 + (t.tv_usec+999) / 1000; +} -- cgit