git.samba.org
/
herb
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b125f6
)
py_tevent: add_timer takes float argument
author
Douglas Bagnall
<douglas.bagnall@catalyst.net.nz>
Thu, 7 Feb 2019 04:00:28 +0000
(17:00 +1300)
committer
Stefan Metzmacher
<metze@samba.org>
Tue, 26 Feb 2019 12:00:11 +0000
(13:00 +0100)
We were already using it that way.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
(cherry picked from commit
8294e68a4175e6116b38869866c42a1b7ba55b6a
)
lib/tevent/pytevent.c
patch
|
blob
|
history
diff --git
a/lib/tevent/pytevent.c
b/lib/tevent/pytevent.c
index 369ec6e02c841fe563ee7505d6f0d3a4295149f7..97976df32d3810a29e3c2fcfecce01590233764c 100644
(file)
--- a/
lib/tevent/pytevent.c
+++ b/
lib/tevent/pytevent.c
@@
-478,9
+478,13
@@
static PyObject *py_tevent_context_add_timer(TeventContext_Object *self, PyObjec
{
struct timeval next_event;
PyObject *callback;
- if (!PyArg_ParseTuple(args, "lO", &next_event, &callback))
+ double secs, usecs;
+ if (!PyArg_ParseTuple(args, "dO", &secs, &callback)){
return NULL;
-
+ }
+ next_event.tv_sec = secs;
+ usecs = (secs - next_event.tv_sec) * 1000000.0;
+ next_event.tv_usec = usecs;
return py_tevent_context_add_timer_internal(self, next_event, callback);
}