summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/util.c5
2 files changed, 6 insertions, 0 deletions
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;
+}