summaryrefslogtreecommitdiff
path: root/src/python-systemd/_reader.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-08 19:46:49 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-08 21:35:03 -0400
commit539e0a4d583bca7db837275b07a20a933b7f8f83 (patch)
tree2a6b6a275354d289d5301bc3f1b9c6f35733ef94 /src/python-systemd/_reader.c
parent5afbe712db5cc68213a24c45396ffb43fab05e3e (diff)
systemd-python: add wrappers for easy functions in sd-login
sd_get_uids, sd_get_seats, sd_get_sessions, and sd_get_machine_names.
Diffstat (limited to 'src/python-systemd/_reader.c')
-rw-r--r--src/python-systemd/_reader.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/python-systemd/_reader.c b/src/python-systemd/_reader.c
index 50ad889201..d20c58d2a8 100644
--- a/src/python-systemd/_reader.c
+++ b/src/python-systemd/_reader.c
@@ -213,19 +213,7 @@ static PyObject* Reader_get_timeout_ms(Reader *self, PyObject *args)
if (r < 0)
return NULL;
- if (t == (uint64_t) -1)
- return PyLong_FromLong(-1);
- else {
- struct timespec ts;
- uint64_t n;
- int msec;
-
- clock_gettime(CLOCK_MONOTONIC, &ts);
- n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
- msec = t > n ? (int) ((t - n + 999) / 1000) : 0;
-
- return PyLong_FromLong(msec);
- }
+ return absolute_timeout(t);
}