s3: Add timeval_to_msec
authorVolker Lendecke <vl@samba.org>
Tue, 8 Feb 2011 11:55:02 +0000 (12:55 +0100)
committerVolker Lendecke <vlendec@samba.org>
Mon, 28 Feb 2011 15:40:19 +0000 (16:40 +0100)
source3/include/proto.h
source3/lib/util.c

index cf58cdf99e9a0e57f017300b41059186663b0366..ba0f7adbde987412fb85bd00cc2d22f4206fa107 100644 (file)
@@ -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  */
 
index 99c4200eb3c210f4121659a5a1a5f52dc7306c84..81d2a78d3ce9620d63cf79bbc1e4a5f4d1f4b392 100644 (file)
@@ -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;
+}