diff options
author | Steven Hiscocks <steven@hiscocks.me.uk> | 2013-02-16 19:10:49 +0000 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-02-22 16:57:44 +0100 |
commit | 518dc5dff557116db3f072eb9d0a9492b6226778 (patch) | |
tree | b5d5c5cf9bce53e10b023fc4d79fee6b11c6d002 /src/python-systemd/_reader.c | |
parent | 83718af6f59fb3a6359c8da1f8bc8b8fd8799106 (diff) |
systemd-python: _reader now takes unix timestamp in seconds
Diffstat (limited to 'src/python-systemd/_reader.c')
-rw-r--r-- | src/python-systemd/_reader.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/python-systemd/_reader.c b/src/python-systemd/_reader.c index 7aa638b076..95e6094162 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; |