summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-08 12:55:02 +0100
committerVolker Lendecke <vlendec@samba.org>2011-02-28 16:40:19 +0100
commit5e93e3e88fb4a219492c23c18067f358b54311d0 (patch)
tree7d7171d86e36bd40f9097ee070cb764fe7dd0fe5 /source3
parent9bfbf652b02f4e0f96854c912c11e679417c8e2c (diff)
downloadsamba-5e93e3e88fb4a219492c23c18067f358b54311d0.tar.gz
samba-5e93e3e88fb4a219492c23c18067f358b54311d0.tar.bz2
samba-5e93e3e88fb4a219492c23c18067f358b54311d0.zip
s3: Add timeval_to_msec
Diffstat (limited to 'source3')
-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;
+}