Merge branch 'my-dbus-1.2'

Conflicts:
	configure.in
This commit is contained in:
Colin Walters 2010-02-02 11:00:09 -05:00
commit 19d48c3344
2 changed files with 16 additions and 3 deletions

View file

@ -2348,7 +2348,8 @@ _dbus_poll (DBusPollFD *fds,
}
/**
* Get current time, as in gettimeofday().
* Get current time, as in gettimeofday(). Use the monotonic clock if
* available, to avoid problems when the system time changes.
*
* @param tv_sec return location for number of seconds
* @param tv_usec return location for number of microseconds (thousandths)
@ -2359,12 +2360,22 @@ _dbus_get_current_time (long *tv_sec,
{
struct timeval t;
#ifdef HAVE_MONOTONIC_CLOCK
struct timespec ts;
clock_gettime (CLOCK_MONOTONIC, &ts);
if (tv_sec)
*tv_sec = ts.tv_sec;
if (tv_usec)
*tv_usec = ts.tv_nsec / 1000;
#else
gettimeofday (&t, NULL);
if (tv_sec)
*tv_sec = t.tv_sec;
if (tv_usec)
*tv_usec = t.tv_usec;
#endif
}
/**

View file

@ -226,7 +226,8 @@ static DBusString process_homedir;
static void
shutdown_system_db (void *data)
{
_dbus_user_database_unref (system_db);
if (system_db != NULL)
_dbus_user_database_unref (system_db);
system_db = NULL;
_dbus_string_free (&process_username);
_dbus_string_free (&process_homedir);
@ -345,7 +346,8 @@ _dbus_user_database_flush_system (void)
{
_dbus_user_database_lock_system ();
_dbus_user_database_flush (system_db);
if (system_db != NULL)
_dbus_user_database_flush (system_db);
_dbus_user_database_unlock_system ();
}