diff options
author | Havoc Pennington <hp@redhat.com> | 2003-01-22 03:36:05 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-01-22 03:36:05 +0000 |
commit | d6d50a29945ded04a17b3f42a3a1074449250ec0 (patch) | |
tree | 7a7df9b568a6e7f7b6a184f525d60bd77e527bb2 /dbus | |
parent | 9e1199fed2c96fe305a27e5d3d4e1950ed2f0d0f (diff) |
2003-01-21 Havoc Pennington <hp@pobox.com>
(patch untested because can't compile)
* bus/driver.c (create_unique_client_name): make this function
never recycle client names. Also, caller should initialize
the DBusString.
* dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/dbus-sysdeps.c | 20 | ||||
-rw-r--r-- | dbus/dbus-sysdeps.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index a4074828..c91a06ff 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -983,4 +983,24 @@ _dbus_sleep_milliseconds (int milliseconds) #endif } +/** + * Get current time, as in gettimeofday(). + * + * @param tv_sec return location for number of seconds + * @param tv_usec return location for number of microseconds (thousandths) + */ +void +_dbus_get_current_time (long *tv_sec, + long *tv_usec) +{ + struct timeval t; + + gettimeofday (&t, NULL); + + if (tv_sec) + *tv_sec = t.tv_sec; + if (tv_usec) + *tv_usec = t.tv_usec; +} + /** @} end of sysdeps */ diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index c76c691a..5b9a0c09 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -118,6 +118,9 @@ int _dbus_poll (DBusPollFD *fds, void _dbus_sleep_milliseconds (int milliseconds); +void _dbus_get_current_time (long *tv_sec, + long *tv_usec); + DBUS_END_DECLS; #endif /* DBUS_SYSDEPS_H */ |