#include "log.h"
#include "dbus-common.h"
#include "util.h"
+#include "def.h"
int bus_check_peercred(DBusConnection *c) {
int fd;
return 1;
}
-#define TIMEOUT_USEC (60*USEC_PER_SEC)
-
static int sync_auth(DBusConnection *bus, DBusError *error) {
usec_t begin, tstamp;
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);
/* If we are root, then let's not go via the bus */
if (geteuid() == 0 && t == DBUS_BUS_SYSTEM) {
- if (!(bus = dbus_connection_open_private("unix:path=/dev/.run/systemd/private", error))) {
+ if (!(bus = dbus_connection_open_private("unix:path=/run/systemd/private", error))) {
#ifndef LEGACY
dbus_error_free(error);