diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2019-02-07 17:00:28 +1300 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2019-02-26 13:00:11 +0100 |
commit | f868654638a32afcb4bfb9b03b4dc87f37f323b0 (patch) | |
tree | 4f8746b79091582bc8fb6285e99d07d8ed6abb3c /lib | |
parent | 6b125f6ce2dc2f095fa8842be0790e82656de796 (diff) | |
download | samba-f868654638a32afcb4bfb9b03b4dc87f37f323b0.tar.gz |
py_tevent: add_timer takes float argument
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)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tevent/pytevent.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c index 369ec6e02c8..97976df32d3 100644 --- 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); } |