X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fpython-systemd%2F_reader.c;h=95e60941622356ac2d5f3a35cd04e19b46550070;hp=7aa638b0766edce9c92859a530a389fbd4277b33;hb=518dc5dff557116db3f072eb9d0a9492b6226778;hpb=83718af6f59fb3a6359c8da1f8bc8b8fd8799106 diff --git a/src/python-systemd/_reader.c b/src/python-systemd/_reader.c index 7aa638b07..95e609416 100644 --- a/src/python-systemd/_reader.c +++ b/src/python-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", ×tamp)) + 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;