1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 11:55:44 +03:00

bus: always return something in sd_bus_get_timeout()

This commit is contained in:
Lennart Poettering 2013-04-01 03:26:38 +02:00
parent ea8f194f4b
commit adee69fa7a

View File

@ -1425,12 +1425,16 @@ int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) {
return 1; 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; return 0;
}
c = prioq_peek(bus->reply_callbacks_prioq); c = prioq_peek(bus->reply_callbacks_prioq);
if (!c) if (!c) {
*timeout_usec = (uint64_t) -1;
return 0; return 0;
}
*timeout_usec = c->timeout; *timeout_usec = c->timeout;
return 1; return 1;