chiark / gitweb /
systemd-python: remove unneeded ifdef for query_unique
[elogind.git] / src / python-systemd / _reader.c
index 7aa638b0766edce9c92859a530a389fbd4277b33..c16cbdcd763b46f1bb3cadf8b665ed76c6a8a406 100644 (file)
@@ -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;
@@ -505,7 +508,6 @@ Journal_iternext(PyObject *self)
     }
 }
 
-#ifdef SD_JOURNAL_FOREACH_UNIQUE
 PyDoc_STRVAR(Journal_query_unique__doc__,
 "query_unique(field) -> a set of values\n\n"
 "Returns a set of unique values in journal for given `field`.\n"
@@ -551,7 +553,6 @@ Journal_query_unique(Journal *self, PyObject *args)
     Py_DECREF(key);
     return value_set;
 }
-#endif //def SD_JOURNAL_FOREACH_UNIQUE
 
 static PyObject *
 Journal_get_data_threshold(Journal *self, void *closure)
@@ -634,10 +635,8 @@ static PyMethodDef Journal_methods[] = {
     Journal_wait__doc__},
     {"seek_cursor", (PyCFunction)Journal_seek_cursor, METH_VARARGS,
     Journal_seek_cursor__doc__},
-#ifdef SD_JOURNAL_FOREACH_UNIQUE
     {"query_unique", (PyCFunction)Journal_query_unique, METH_VARARGS,
     Journal_query_unique__doc__},
-#endif
     {NULL}  /* Sentinel */
 };