diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-04-01 03:26:38 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-01 03:29:30 +0200 |
commit | adee69fa7a26df2f1b63cb813c1074f51a2a2612 (patch) | |
tree | 62ba12aa9632b8f98850c6f3f7d793b270751d4c /src | |
parent | ea8f194f4b402774aafb9bc3c3ea1c0f288f12a7 (diff) |
bus: always return something in sd_bus_get_timeout()
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-bus/sd-bus.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c index 4f004add2e..0964649e39 100644 --- a/src/libsystemd-bus/sd-bus.c +++ b/src/libsystemd-bus/sd-bus.c @@ -1425,12 +1425,16 @@ int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) { return 1; } - if (bus->state != BUS_RUNNING && bus->state != BUS_HELLO) + if (bus->state != BUS_RUNNING && bus->state != BUS_HELLO) { + *timeout_usec = (uint64_t) -1; return 0; + } c = prioq_peek(bus->reply_callbacks_prioq); - if (!c) + if (!c) { + *timeout_usec = (uint64_t) -1; return 0; + } *timeout_usec = c->timeout; return 1; |