diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-03-17 04:02:35 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-03-17 04:02:35 +0100 |
commit | f6a6225e414858ff222d2b175369cc42459abf9a (patch) | |
tree | c4c15d546c5c514d2d7dfabbf64d10944e9edc85 /src/dbus-common.c | |
parent | b74949bcdc65982a5eaca64c836f4d2a3b8a8d0c (diff) |
def: centralize definition of default timeout in one place
Diffstat (limited to 'src/dbus-common.c')
-rw-r--r-- | src/dbus-common.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/dbus-common.c b/src/dbus-common.c index bb9cf2e2ab..e352b8cf99 100644 --- a/src/dbus-common.c +++ b/src/dbus-common.c @@ -30,6 +30,7 @@ #include "log.h" #include "dbus-common.h" #include "util.h" +#include "def.h" int bus_check_peercred(DBusConnection *c) { int fd; @@ -57,8 +58,6 @@ int bus_check_peercred(DBusConnection *c) { return 1; } -#define TIMEOUT_USEC (60*USEC_PER_SEC) - static int sync_auth(DBusConnection *bus, DBusError *error) { usec_t begin, tstamp; @@ -71,13 +70,13 @@ static int sync_auth(DBusConnection *bus, DBusError *error) { begin = tstamp = now(CLOCK_MONOTONIC); for (;;) { - if (tstamp > begin + TIMEOUT_USEC) + if (tstamp > begin + DEFAULT_TIMEOUT_USEC) break; if (dbus_connection_get_is_authenticated(bus)) break; - if (!dbus_connection_read_write_dispatch(bus, ((begin + TIMEOUT_USEC - tstamp) + USEC_PER_MSEC - 1) / USEC_PER_MSEC)) + if (!dbus_connection_read_write_dispatch(bus, ((begin + DEFAULT_TIMEOUT_USEC - tstamp) + USEC_PER_MSEC - 1) / USEC_PER_MSEC)) break; tstamp = now(CLOCK_MONOTONIC); |