summaryrefslogtreecommitdiff
path: root/systemd/_reader.c
diff options
context:
space:
mode:
authorSteven Hiscocks <steven@hiscocks.me.uk>2013-02-16 19:10:49 +0000
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-07-05 14:19:15 -0400
commit445332cb69386e8696332403aca55c60c1df5de7 (patch)
tree3e60519ad390487df1f349aa3c2442fa35ef9803 /systemd/_reader.c
parent029ac59922161565cccbe40e0aeb21af119d4b00 (diff)
downloadpython-systemd-445332cb69386e8696332403aca55c60c1df5de7.tar.gz
systemd-python: _reader now takes unix timestamp in seconds
Diffstat (limited to 'systemd/_reader.c')
-rw-r--r--systemd/_reader.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/systemd/_reader.c b/systemd/_reader.c
index 7aa638b..95e6094 100644
--- a/systemd/_reader.c
+++ b/systemd/_reader.c
@@ -336,14 +336,17 @@ Journal_seek(Journal *self, PyObject *args, PyObject *keywds)
PyDoc_STRVAR(Journal_seek_realtime__doc__,
"seek_realtime(realtime) -> None\n\n"
"Seek to nearest matching journal entry to `realtime`. Argument\n"
-"`realtime` can must be an integer unix timestamp in usecs.");
+"`realtime` can must be an integer unix timestamp.");
static PyObject *
Journal_seek_realtime(Journal *self, PyObject *args)
{
- uint64_t timestamp;
- if (! PyArg_ParseTuple(args, "K", &timestamp))
+ double timedouble;
+ if (! PyArg_ParseTuple(args, "d", &timedouble))
return NULL;
+ uint64_t timestamp;
+ timestamp = (uint64_t) (timedouble * 1.0E6);
+
if ((int64_t) timestamp < 0LL) {
PyErr_SetString(PyExc_ValueError, "Time must be positive integer");
return NULL;